das-developers / das2java

The original das2 library. Provides interactive publication-ready 2-D plotting
https://das2.org
GNU Lesser General Public License v3.0
4 stars 0 forks source link

New code for log-y-axis when 1.5 cycles is visible doesn't work well with log-x-axis #51

Closed jbfaden closed 1 year ago

jbfaden commented 1 year ago

There's new code to calculate labels for the y axis when it is log and has a small number of cycles (0.5 to 5 for example), and it messes up when the x axis is log, at least when they are connected by a DataRange object.

Also the new code doesn't consider the height when calculating ticks. This should also be resolved.

jbfaden commented 1 year ago

This is looking better now, and considers the number of ticks to target.

jbfaden commented 1 year ago

I'm backing this out until next week, since this needs to be done early in the day because so many Autoplot tests fail.

jbfaden commented 1 year ago

new 1.5-cycle log ticks code introduced again and Autoplot jenkins tests are resolved.

jbfaden commented 1 year ago

James says: "I pulled the latest and while it did better for ~1.5 decades, the labels disappeared on my color bar. Specifically, I started out with the full default range for the plot, which was about 4 decades. I then zoomed in to about 1.5-2 decades. Then I clicked about ¾ of the way up and dragged down past the bottom of the color bar in the hopes that it would accept the new upper point (where I clicked) and zoom out on the lower end. That’s when the labels just altogether disappeared."

It sounds like a 0 is getting into the minor ticks.

jbfaden commented 1 year ago

Also I need to add "1" in addition to 2,4,6,8 ticks.

jbfaden commented 1 year ago

James and I weren't able to reproduce the problem he saw, where presumably 0 was getting into the ticks. Also I think 0 would probably not cause problems, since each of the tick values is transformed, and 0 must be handled. He's keeping an eye out for this.

"1", or actually "10" is added when counting off linear ticks with 2,4,6,8,10. Before it would only count off 2,4,6,8 so the major boundary didn't have a tick.

jbfaden commented 1 year ago

I've verified that an x-axis with log ticks is working fine, too. See https://github.com/autoplot/dev/blob/master/demos/2023/20230422/LogXaxisIssue51.jy