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

more colorbars #57

Open jbfaden opened 1 year ago

jbfaden commented 1 year ago

Ivar asked for a wrapping colorbar, where the color of the min is the same as the max. He would use this to represent angles. There's a wrapped color wedge, but oddly this is the only one. There is a way for colorbars to be added at runtime in Autoplot, see ScriptContext.makeColorTable which calls the Das2 makeColorTable.

The new colorbars we'll need are:

It also occurred to me colorbars should identify themselves for appropriate use. "Bipolar" is the term I've always used to describe colorbars which show distance from zero in a positive or negative direction. These colorbars have a meaningful (usually neutral) color at the center. "Modulo" (or maybe cyclic) indicates the two ends have the same color It also occurred to me colorbars should identify themselves as bipolar, and zero should be located at the center of the bar to indicate, and modulo (or cyclic?) to indicate that the two ends have the same color. This might be used to show direction angles in a vector field.

jbfaden commented 1 year ago

Ivar suggests blue_to_orange but with min and max black.

jbfaden commented 1 year ago

I thought there was an Autoplot ticket with a website containing many colorbars, but I'm not seeing it. This has a number of bars: https://www.kaggle.com/code/simayanpati/color-bar-for-python-visualization

jbfaden commented 1 year ago

makeColorTable seems strange to me. I thought it was not sensitive to the indexes, but it clearly is. See https://github.com/autoplot/dev/blob/master/demos/2023/20230411/demoMakeColorTable2.jy

jbfaden commented 1 year ago

I've added several colorbars to das2. See http://autoplot.org/jnlp/20230412a/screen.png

jbfaden commented 1 year ago

screen

jbfaden commented 1 year ago

See also https://github.com/das-developers/das2java/issues/58

jbfaden commented 1 year ago

I'll leave this ticket open for other colorbars needed in the future.