I would like to make easy to change the variable for which I am making a set of plots. Say I want to plot Sin, Tan, Cos and other functions of the same argument. To quickly switch from plotting it as function of x or y I wanted to use a "dummy" plot variable var and assing it to y or x depending on the need.
x = 1; var = y;
Plot[Sin[x*y], {var, 1, 2}]
Plot[Tan[x*y], {var, 1, 2}]
Plot[Cos[x*y], {var, 1, 2}]
Unset[{x, y, var}];
Unfortunately this doesn't quite works because var
in the range specification {var,1,2}
is not evaluated.
Any suggestions?
Evaluate@{var, 1, 2}
... $\endgroup$Evaluate[var]
which was my trial before posting here? $\endgroup$Evaluate
works only on first level. $\endgroup$