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

Ivar's 255 step colorbar loads incorrectly #58

Closed jbfaden closed 1 year ago

jbfaden commented 1 year ago

Ivar and I noticed that his 255-step colorbar, with white in the exact middle of the bar, loads improperly. See the image below, where white appears slightly above the horizontal, instead of at the horizontal.

image

jbfaden commented 1 year ago

I assumed this was with the data loading and my handling of the data, but was actually because an "if" statement was used to advance a pointer when a "while" statement was needed. Sometimes the pointer needed to advance by two but could only advance by one, and would thereby fail to keep up with where it should be. See https://github.com/das-developers/das2java/blob/8c931385663f3c0e35417c01432fa86d7e2783e7/dasCore/src/org/das2/graph/DasColorBar.java#L679

jbfaden commented 1 year ago

Corrected: image