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

Manual control of tick locations #24

Open jbfaden opened 2 years ago

jbfaden commented 2 years ago

On Autoplot there's been a ticket about manual positioning of the ticks (https://sourceforge.net/p/autoplot/feature-requests/469/), and this should really be in the das2java project. There's a consistent method for specifying tick locations with the tickValues property of the axes. This can be:

jbfaden commented 2 years ago

This is used in other places, too like:

jbfaden commented 2 years ago

GraphUtil.calculateManualTicks is where this logic lives.

jbfaden commented 2 years ago

Ali commented that 0.0,30.0,60.0 is used as the format when 0,30,60 would be preferred. I'm correcting this now.

jbfaden commented 2 years ago
jbfaden commented 2 years ago

This has been working nicely, but we just noticed that +3hr/+1hr for "2022-03-04" resolves incorrectly. The divisor mode works fine (+3hr/3), but it looks like when the + mode is used two time locations' doubles are added together.

Autoplot script to demo:

setScriptDescription('Demos new bug with https://github.com/das-developers/das2java/issues/24')

from org.das2.graph import GraphUtil
ticks= GraphUtil.calculateManualTicks( '+3hr/+1hr',datumRange('2022-03-04'),False)

print ticks.getMajorTicks().get(0)  #2022-03-04T00:00:00.000Z
print ticks.getMinorTicks().get(0)  #2044-05-05T00:00:00.000Z
jbfaden commented 2 years ago
jbfaden commented 2 years ago

the Contours plot now supports minor ticks.