I've got a plot – the x axis is in radian (from pi/2 to pi) and with gnuplot it works like a charm – the problem is – that my x-axis labeling should be in degree (-90, -75,…,90) and i'm kinda stuck.
Should i change everything to degree or is there an option to achieve this with altering the ticks?
\documentclass{article}
\usepackage{tikz,pgfplots}
\begin{document}
\begin{tikzpicture}[plot/.style={very thick,raw gnuplot,mark=none,black}]
\begin{axis}[minor y tick num=3, minor x tick num=1, width=\textwidth, domain=-pi/2:pi/2,
ymin=0, ymax=1.3, xmin=-1.571, xmax=1.571, grid=both, y=5cm, axis y line=left, axis x line=bottom]
\addplot gnuplot [plot,red]
{ ag1(x) = 0.5 + 0.2*sin(10*x);plot[-pi/2:pi/2]ag1(x)};
\end{axis} \end{tikzpicture}
\end{document}
It should look similar to this picture:
Best Answer
You can set
gnuplot
to use degrees for angles withset angles degrees;
:Alternatively, you can convert your result to degrees using an
x filter
: