Welcome to our community

Be a part of something great, join today!

TiKZ -b.2.2.21 scaling picture

karush

Well-known member
Jan 31, 2012
3,055
as you see from %[scale=0.8]
I tried to scale the picture but it didn't after removing the %

\begin{tikzpicture}%[scale=0.8]
[declare function = {
tilde_y(\q) = sign(\q)*sqrt(abs(\q) / (1 - (abs(\q)-3)^3));},
pics/coordinates/.style args={(#1,#2),(#3,#4)}{ code={
%\draw[help lines] (#1,#2) grid (#3,#4);
\draw[-latex] (#1,0) -- (#3,0);
\draw[-latex] (0,#2) -- (0,#4);
%\node foreach \i in {#1,...,#3} at (\i,-0.1) [ below ] {$\i$};
%\node foreach \i in {#2,...,#4} at (-0.1,\i) [ left ] {$\i$};
}},
every node/.style={fill=black!5},
fill=black!5,]
\pic {coordinates={(-3,-2),(3,4)}};
\begin{scope}[draw=blue, ultra thick]
\draw[domain=-3.5:3.5, variable=\q, smooth] plot ({(abs(\q) - 3) * tilde_y(\q)}, {1 + tilde_y(\q)});
\filldraw foreach \p in {(1,3),(-1,2),(1,0),(-1,-1)} { \p circle (0.06) };
\end{scope}
\end{tikzpicture}
 
Last edited:

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
9,569
as you see from %[scale=0.8]
I tried to scale the picture but it didn't after removing the %
There are already square brackets after \begin{tikzpicture}, which contain the declare function.
The scale must be inside like [scale=0.8, declare function....
When we do so, we get:
\begin{tikzpicture}
[scale=0.8, declare function = {
tilde_y(\q) = sign(\q)*sqrt(abs(\q) / (1 - (abs(\q)-3)^3));},
pics/coordinates/.style args={(#1,#2),(#3,#4)}{ code={
%\draw[help lines] (#1,#2) grid (#3,#4);
\draw[-latex] (#1,0) -- (#3,0);
\draw[-latex] (0,#2) -- (0,#4);
%\node foreach \i in {#1,...,#3} at (\i,-0.1) [ below ] {$\i$};
%\node foreach \i in {#2,...,#4} at (-0.1,\i) [ left ] {$\i$};
}},
every node/.style={fill=black!5},
fill=black!5,]
\pic {coordinates={(-3,-2),(3,4)}};
\begin{scope}[draw=blue, ultra thick]
\draw[domain=-3.5:3.5, variable=\q, smooth] plot ({(abs(\q) - 3) * tilde_y(\q)}, {1 + tilde_y(\q)});
\filldraw foreach \p in {(1,3),(-1,2),(1,0),(-1,-1)} { \p circle (0.06) };
\end{scope}
\end{tikzpicture}
 

karush

Well-known member
Jan 31, 2012
3,055
mahalo, yes I didn't know that....
i was going to put x and y ticks in where the critical points are but
but will try from previous examples
don't really need here but just want to see how it works
the one think i didn't like about desmos was the very limited setup for ticks