I want to label a scale based on a variable value and I wrote a metapost code like this.
$ := 1;
for i = -.3cm step .6cm until 3.6cm:
label.bot(str$,(i,-3.7cm));
$ := incr($);
endfor;
It just labels "$" instead of its value. How to output the variables value?
Best Answer
To get the value of the variable, use the
decimal
macro. The following works:To quote the MetaPost manual:
further