-
Notifications
You must be signed in to change notification settings - Fork 35
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
Possible improvement of hplot.Ticks{N: 10} #629
Comments
do you have a somewhat simple reproducer I could play with? |
Yes, you can have a look at the test of https://github.com/rmadar/hplot-style . To reproduce the problem, you just have to comment or not the line https://github.com/rmadar/hplot-style/blob/master/style/style.go#L58 and re-run the example. |
Whaaat ??? ;-) I think your proposal is really good! I was just wondering why the row 5 and 6 have the same ticks in your case while David's algorithm yields to different ticks (I am actually not sure what change from 1 row to another) In any case, I would maybe propose to have a number formatting without decimals for raw 5 and 6 (if that's easy to do - I have no idea how these things work), i.e. Otherwise, it looks very good to me! |
don't tell him I said that. what does change from row-to-row (besides the xmin/xmax) is the number of required rows:
oops, forgot to change back the requested number of ticks... type Ticks struct {
N int
Fmt string // e.g. "%8.2f"
} |
I like the idea of the formatting string to be more flexible. I think we can go for it and see in practice how (in)convenient this is. But I'd say it's a good move! |
On the example below, I show the default tick of
gonum/v1/plot
(left) and the output ofhplot.Ticks{N: 10}
command (right). While it seems to have the desired effect on the x-axis, it doesn't seem to be as nice for y-axis (int his particular example). If I understand correctly,N
is supposed to be the maximum number of major ticks, and there is 0 major ticks on the right.The text was updated successfully, but these errors were encountered: