Here I present a solution using non-linear spacing that also works for quite low values for C or "high" values for Max
(see code). For example test with values 0.1, 0.2 and 0.3 respectively or a Max
value of 10. They work perfectly fine using only 22 samples per (full) line.
For details on how the solution works, please have a look at the comments in the code.
% used PGFPlots v1.16
\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
% load library to use a "cool" `cycle list'
\usetikzlibrary{
pgfplots.colorbrewer,
}
\pgfplotsset{
% use this `compat' level or higher to use the advanced positioning
% for the axis labels
compat=1.3,
/pgf/declare function={
% declare a variable to store the min and max value for the function
Max=5;
% declare the function to use
f(\C,\x) = \C/\x;
%
% -----------------------------------------------------------------
% calculate the lower and upper boundaries (the domain values)
lb(\C) = sqrt(\C);
ub = Max;
%
%%% non-linear spacing: <https://stackoverflow.com/a/39140096/5776000>
% "non-linearity factor"
a = 1.0;
% function to use for the non-linear spacing
Y(\x) = exp(a*\x);
% rescale to former limits
X(\C,\x) = (Y(\x) - Y(lb(\C)))/(Y(ub) - Y(lb(\C))) * (ub - lb(\C)) + lb(\C);
% -----------------------------------------------------------------
},
% load a "cool" cycle list
cycle list/Blues-5,
}
\begin{document}
\begin{tikzpicture}[
% define a style for the plot labels
Label/.style={
node font=\tiny,
black,
pos=#1,
},
]
\begin{axis}[
% axis lines should be centered
axis lines=center,
% set axis labels
xlabel={$x$},
ylabel={$f(x)$},
% set them right and above the axis lines, respectively
xlabel style={
at={(xticklabel* cs:1)},
anchor=west,
},
ylabel style={
at={(yticklabel* cs:1)},
anchor=south,
},
% axis unit ratio should be the same for both axis lines
axis equal image=true,
% don't show any ticks (and tick labels)
ticks=none,
% the lines should be `smooth'
smooth,
% when using the non-linear spacing approach you don't need that much samples
samples=11,
% % ---------------------------------------------------------------------
% % for debugging purposes only
% % ---------------------------------------------------------------------
% % add small marks to the lines
% every axis plot post/.append style={
% mark=*,
% mark size=0.3pt,
% },
% % ---------------------------------------------------------------------
]
% first draw the lines for $C = 0$
\pgfplotsinvokeforeach {0} {
% the horizontal line
% used `forget plot' so the `cycle list index' isn't increased
\addplot+ [domain=-Max:Max,forget plot,>->] {#1}
node [Label=0.4,above] {$C = #1$}
node [Label=0.6,above] {$C = #1$}
;
% the vertical line
\addplot+ [domain=-Max:Max,>->] (#1,x)
node [Label=0.25,left] {$#1$}
node [Label=0.75,left] {$#1$}
;
}
% define a length for the shift of the plot labels
% (using "above left" and similar causes the labels to be
% "too far away" from the plot they belong to and are almost
% *in* the next plot)
\pgfmathsetlengthmacro{\Shift}{3pt}
% define a factor to enlarge the domain to get the parabolic effect
% of the end points of the different "C" plots
% (for linear spacing use the value 0.25)
\pgfmathsetmacro{\Factor}{0.01}
% now draw plots for $C > 0$
\pgfplotsinvokeforeach {1,2,3} {
% to do so we split each line into two part
% this is advantage because of the symmetry of the lines and
% thus we can avoid the need for a lot of "samples" in the steep
% parts of the curve.
%
% -----------------------------------------------------------------
% linear spacing approach
% -----------------------------------------------------------------
% % quadrant I
% \addplot+ [domain=+sqrt(#1):{Max+\Factor*#1},forget plot,->] {f(#1,x)}
% node [Label=0,shift={(\Shift,\Shift)}] {$+#1$};
% % the steep parts can be drawn using a parametric plot
% \addplot+ [domain=+sqrt(#1):{Max+\Factor*#1},forget plot,-<] ({f(#1,x)},x);
%
% % quadrant II
% \addplot+ [domain={-Max-\Factor*#1}:-sqrt(#1),forget plot,>-] {-f(#1,x)}
% node [Label=1,shift={(-\Shift,\Shift)}] {$-#1$};
% \addplot+ [domain=+sqrt(#1):{Max+\Factor*#1},forget plot,->] ({-f(#1,x)},x);
%
% % quadrant III
% \addplot+ [domain={-Max-\Factor*#1}:-sqrt(#1),forget plot,>-] {f(#1,x)}
% node [Label=1,shift={(-\Shift,-\Shift)}] {$+#1$};
% \addplot+ [domain={-Max-\Factor*#1}:-sqrt(#1),forget plot,<-] ({f(#1,x)},x);
%
% % quadrant IV
% \addplot+ [domain=+sqrt(#1):{Max+\Factor*#1},forget plot,->] {-f(#1,x)}
% node [Label=0,shift={(\Shift,-\Shift)}] {$-#1$};
% \addplot+ [domain={-Max-\Factor*#1}:-sqrt(#1),>-] ({-f(#1,x)},x);
% -----------------------------------------------------------------
% non-linear spacing approach
% -----------------------------------------------------------------
% quadrant I
\addplot+ [domain=+sqrt(#1):Max+\Factor*(#1)^2,forget plot,->] ({X(#1,x)},{f(#1,X(#1,x))})
node [Label=0,shift={(\Shift,\Shift)}] {$+#1$};
% the steep parts can be drawn using a parametric plot
\addplot+ [domain=+sqrt(#1):Max+\Factor*(#1)^2,forget plot,-<] ({f(#1,X(#1,x))},{X(#1,x)});
% quadrant II
\addplot+ [domain=+sqrt(#1):Max+\Factor*(#1)^2,forget plot,-<] ({-X(#1,x)},{f(#1,X(#1,x))})
node [Label=0,shift={(-\Shift,\Shift)}] {$-#1$};
\addplot+ [domain=+sqrt(#1):Max+\Factor*(#1)^2,forget plot,->] ({-f(#1,X(#1,x))},{X(#1,x)});
% quadrant III
\addplot+ [domain=+sqrt(#1):Max+\Factor*(#1)^2,forget plot,-<] ({-X(#1,x)},{-f(#1,X(#1,x))})
node [Label=0,shift={(-\Shift,-\Shift)}] {$+#1$};
\addplot+ [domain=+sqrt(#1):Max+\Factor*(#1)^2,forget plot,->] ({-f(#1,X(#1,x))},-{X(#1,x)});
% quadrant IV
\addplot+ [domain=+sqrt(#1):Max+\Factor*(#1)^2,forget plot,->] ({X(#1,x)},{-f(#1,X(#1,x))})
node [Label=0,shift={(\Shift,-\Shift)}] {$-#1$};
\addplot+ [domain=+sqrt(#1):Max+\Factor*(#1)^2,-<] ({f(#1,X(#1,x))},{-X(#1,x)});
}
\end{axis}
\end{tikzpicture}
\end{document}
