Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is there a simple way to switch the x- and y-axes, so that the x-axis becomes the vertical axis?

\begin{tikzpicture}
\begin{axis}
\addplot+[domain=0:10]{1.2*0.000001*(0.2*(x*1000)^2 + 700*x*1000 + 25000)*2};
\end{axis}
\end{tikzpicture}
share|improve this question
add comment

1 Answer

up vote 10 down vote accepted

Instead of plotting \addplot {<math expression>}, you can use \addplot ({<x math expression>},{<y math expression>}), so in your case

\addplot+[domain=0:10] ({1.2*0.000001*(0.2*(x*1000)^2 + 700*x*1000 + 25000)*2},{x});

\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot+[domain=0:10](1.2*0.000001*(0.2*(x*1000)^2 + 700*x*1000 + 25000)*2,x);
\end{axis}
\end{tikzpicture}
\end{document}
share|improve this answer
    
Fantastic! For a long time I have been searching for this answer. Thank you very much. –  jon86 Mar 8 '13 at 12:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.