Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default value of ticks for graph.xaxis may not always be reasonable? #416

Open
user202729 opened this issue Jan 3, 2024 · 0 comments
Open

Comments

@user202729
Copy link

Example:

import graph;
size(4cm);
xaxis("$x$", xmin=1, xmax=10, Ticks());
draw(graph(new real(real x){return x^2/32;}, 1, 10));

Result: no ticks is drawn.

In the documentation, it's stated that "if values like N, n, Step, step are not specified, reasonable defaults will be chosen".

I think it would be useful to add to the documentation something like:

You should draw the axis after all the graphs are drawn, so that the extent can be determined.

(or so it appears. In the code above, if xaxis is moved to the last line, the ticks are indeed reasonably chosen.)

And to add to the source code (the logic to find the tick values to drawn) such that, if none of N, Step is specified, then at least one tick should be drawn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant