Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass{standalone}
- \usepackage{pgfplots}
- \pgfplotsset{compat=newest}
- \usepackage{amsmath}
- \begin{document}
- \begin{tikzpicture}
- \begin{axis}[
- legend cell align=left,
- legend style={legend pos=north west}
- ]
- % added colours to plots
- \addplot[blue,domain=0:2] {x^2};
- \addplot[red,domain=0:4] {x};
- \addplot[orange,domain=0:4]{4-x};
- \legend{
- $\begin{aligned}[t]
- yy&=x^2\\[-2pt]
- y&=x\\
- yyy&=4-x
- \end{aligned}$,
- \strut % second legend entry
- }
- \end{axis}
- \end{tikzpicture}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment