2

I would like to plot a rotated curve (gaussian) but I've got no idea how. I searched in the internet and found that I have to define the gaussian curve because it's not included. But how can I plot such a function rotated by 270°?

Thanks!

1 Answers1

4

You could plot your Gaussian curve with 1/sqrt(2pi)e^{-x^2/2} in PGFPlots. Then you could use the standalone package to include the figure and use the options to rotate the image.

\begin{figure}
\includestandalone[mode = image]{myplot}
\end{figure}

Here is a post on 4 different ways to rotate a figure: Rotate picture with caption

Or you could simply rotate the PGFPlots with option rotate around = 270 and then insert standalone figure.

How to make the plot rotated:

\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat = newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
anchor = origin,
rotate around={270:(current axis.origin)},
hide axis
]
\addplot[smooth, domain=-5:5] {1/sqrt(2*pi)*exp(-\x^2/2)}; 
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

dustin
  • 18,617
  • 23
  • 99
  • 204
  • Hey, thanks for the fast answer! I've got another question: In my plot there are three curves with axis (plotted without pgf) in a row. I need to add this plot to the row of my pictures (as fourth plot) and connect the thirt picture with the fourth by a dashed line. Is it possible to connect a pgf picture with a normal one? The Axis have to be on the same height. – Deuterium42 Sep 29 '14 at 15:40
  • @Deuterium42 you should start a new question and post the code and image of what you have currently so it will be easy to understand for the answerers. – dustin Sep 29 '14 at 15:41
  • Ok, I will post it later/tomorrow because I'm on the way home now and posting via smartphone (where I haven't the code) – Deuterium42 Sep 29 '14 at 15:43
  • Hey, I've included your code to my one and it works! But one last question left: Is it possible to shift the curve to a given coordinate e.g. (3.0,30)? – Deuterium42 Sep 30 '14 at 09:06
  • Hey, I solved the problem by shifting the function due to the x arguement. Thanks for your patience! – Deuterium42 Sep 30 '14 at 11:17