Ciao
Il seguente codice me le dispone in orizzontale. Mi puoi dire dove sbaglio?
`
\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}
\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}
\vspace{1pt}
\begin{tikzpicture}
\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}
`
cfiandra” post=95199
Ma come faccio per avere le figure in verticale, allineate con l’asse delle ordinate?
Beh, se non passi l’opzione [tt]tikz[/tt] alla classe e tutte le figure hanno la bounding box con il limite inferiore uguale sei a posto.
Ciao
Claudio