4

I have a graph whose x-axis goes from 2000 to 10,000. Unfortunately, the tick labels are "2000" on one end and "1 X 104" on the other. How can I avoid or prevent this?

I tried giving an explicit list of Ticks to LeftTicks. My current axis code is:

import fontsize;
import graph;
// ...
defaultpen(fontsize(7));
real[] graph_ticks={2000,6000,10000};
xaxis("Mean (ms)" ,BottomTop,LeftTicks(Ticks=graph_ticks));
yaxis("Probability",LeftRight,RightTicks(trailingzero));

1 Answer 1

4

You can use the Format parameter of the LeftTicks (or RightTicks) method to specify a C-style format string. "%f" will give regular decimal floating point:

defaultpen(fontsize(7)); // requires import fontsize;
real[] graph_ticks={2000,6000,10000};
xaxis("Mean (ms)",BottomTop,LeftTicks(Format="%f",Ticks=graph_ticks));
yaxis("Probability",LeftRight,RightTicks(trailingzero));

As it happens, trailingzero seems to be a special sort of format string in Asymptote. "%" will allow you to suppress tick labels altogether.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .