I would like to know, how to plot a graph, for example of this function:

$f(t)=-\frac{4 \sin \left(\frac{\gamma t}{2}\right)}{\gamma ^2 t}-\frac{4 \sin ^2\left(\frac{\gamma t}{4}\right)}{\gamma }-\frac{2 \cos \left(\frac{\gamma t}{2}\right)}{\gamma }+\frac{\pi t}{2}$ where $t$ is a variable and $\gamma$ is some constant parameter. Is there a possibility to plot it with x axis being in units of notjust $t$, but in units of $\gamma t$?

I was thinking it could be done something like this, but it does not work:

Plot[f(t), {\[Gamma]*t, 0, 40}]
  • $\begingroup$ Would ParametricPlot[{\[Gamma]*t, f[t]}, {t, 0, 40}] do what you want? $\endgroup$
    – MarcoB
    Commented May 20, 2020 at 0:30
  • $\begingroup$ It kinda seems to work, but for \Gamma values less than 1 it gives seemingly correct, but really weird scaled plot. Thanks! Seems, that @Vitaliy Kaurov answer works as well! $\endgroup$ Commented May 20, 2020 at 6:20
  • $\begingroup$ Welcome to the forum. Thanks for accepting the answer. You should give it an upvote too if you fin dit useful :-) please see the intro for newcomers. $\endgroup$ Commented May 20, 2020 at 12:12

1 Answer 1


This is your function:

f[g_,t_]:=-4Sin[g t/2]/g^2/t-4Sin[g t/4]^2/g-2Cos[g t/2]/g+Pi t/2

With transformed variable $z=g*t$ you get a new function:


$$\frac{\pi z}{2 g}-\frac{4 \sin ^2\left(\frac{z}{4}\right)}{g}-\frac{4 \sin \left(\frac{z}{2}\right)}{g z}-\frac{2 \cos \left(\frac{z}{2}\right)}{g}$$

which you plot (with, for example, $g=1$) as

Plot[h[1, z], {z, 0, 10}]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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