Processing math: 100%
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Evaluate variable in plot label

I have several plots with labels that I would like to evaluate. For instance

all=[plot(x^(1/(i+1)),(x,0,4), rgbcolor=hue(i/10),axes_labels=[r"$x$",r"$x^{1/(1+%d)}$"%i]) for i in range(4)]

leads to all[2] showing me (sorry for not being able to upload due to <60 points) the plot lablel x1/(1+1), which I would like to display after evaluation (x1/2)

By defining the function f(i)=i+1 in the preamble of the graph I still cannot evaluate f, for i is not evaluated inside the list

Even supposing I would, suppose I want the exponent in digits form. I am unable to find the string splicing character which also evaluates and then displays 0.5 (instead of a single digit). Does anybody know about how to correct this syntax?