- Questo topic ha 1 risposta, 2 partecipanti ed è stato aggiornato l'ultima volta 11 anni, 5 mesi fa da .
-
Topic
-
salve ho il seguente codice
`
\documentclass{standalone}
\usepackage{pgfplots}
\usetikzlibrary{calc}
% Grouping the common style settings here to make the code below easier to read
\pgfkeys{/pgfplots/Axis Style/.style={
% width=13.5cm, height=5cm,
axis x line=center,
axis y line=middle,
samples=100,
ymin=-3, ymax=3,
xmin=0, xmax=7.0,
domain=-2*pi:2*pi
}}\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro{\valomega}{2.0};
\pgfmathsetmacro{\valT}{2.0*3.14/\valomega};\begin{axis}
[
Axis Style,
xtick={
0, \valT/4.0, \valT/2, \valT,
3*\valT/4,2*\valT
},
xticklabels={
$0$, $\frac{T}{4}$, $\frac{T}{2}$,
$T$, $\frac{3T}{4}$, $T$
}
]
\addplot [mark=none, thick, blue] {2*sin(deg(2*x))};
\end{axis}
\end{tikzpicture}\end{document}
`
volevo automatizzare un po il calcolo dei parametri ma non compila che fare?
ciao
claudio
- Devi essere connesso per rispondere a questo topic.