GitHubLionel / wxMathPlot

An enhanced version of the wxMathPlot component for wxWidgets
14 stars 5 forks source link

Y axis label goes to different place #19

Open asmwarrior opened 11 months ago

asmwarrior commented 11 months ago

Hi, when I use the mouse wheel to zoom in or zoom out of the graph, I see that most of the time, the Y axis label is at the left edge, but sometimes, it will go up to the top.

See the image below:

image

image

So, I guess this is a bug?

Thanks.

asmwarrior commented 11 months ago

https://github.com/GitHubLionel/wxMathPlot/blob/93a3405d3fb03e2eb72ae5c8cb8f070a9e587b67/mathplot/mathplot.cpp#L1487C1-L1498C6

Looks like this cause the issue, but I'm not sure the logic here.

GitHubLionel commented 11 months ago

I think this is a "normal" behaviour. The position of the label is conditioned by the length of the ticks. When you zoom, the length of the ticks is bigger (with 3 digits), so the program consider that there is not enough space for the label in the margin. Try to enlarge the left margin.