DirkPitt” post=95214Effettivamente e’ elegante, pero’ le due funzioni sono ancora allineate orizzontalmente 🙁
😳 È perché oggi non ne azzecco una!
Ma se le vuoi allineate verticalmente, non è meglio usare l’opzione [tt]tikz[/tt] per verifica? In questo caso credo sia conveniente definirsi a mano la bounding box.
`\documentclass
{standalone}
\usepackage{pgfplots}
\usepackage{kpfonts}
\pgfplotsset{every axis/.append style={
axis x line=bottom,
axis line style={->},
xlabel={$\rho$},
axis lines = left,
xtick = \empty,
ytick = \empty,
every axis x label/.style={at={(axis description cs:1,0)},anchor=west},
every axis y label/.style={at={(axis description cs:0,1)},anchor=east}
},
}
\tikzset{>=stealth}
\begin{document}
\begin{tikzpicture}
\useasboundingbox (-0.5,-0.5) rectangle (7.5,6);
\begin{axis}[
ylabel=$D$,
xmin=0,xmax=5,
ymin=-1,ymax=6,
]
\addplot[domain = 0:1]{5*x};
\addplot[domain=1:4]{5};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\useasboundingbox (-0.5125,-0.5) rectangle (7.5,6);
\begin{axis}[
ylabel = $S$,
xtick = {1, 4},
xticklabels = {$\rho_c$, $\rho_j$},
xmin=0,xmax=5,
ymin=-1,ymax=6,
]
\addplot[domain = 0:1]{5};
\addplot[domain=1:4]{-5/3 * (x-1) + 5};
\end{axis}
\end{tikzpicture}
\end{document}`
Ciao
Claudio