You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be awesome if color schemes could be inverted, e.g.,
from the red sea example. In the picture, I am using redblue color scheme, but due to ordering, colder temperatures are red and warmer temperatures are blue, which is a little counter-intuitive and it would theoretically be nice to display the legend with the opposite color ordering. There is no bluered color scheme in vega-lite, so in order to get the color scheme inverted, you have to invert the upper and lower bound of the domain, something like adding domain=[1, 0] to the scale call:
I think user-side, this would look something like having a checkbox titled Invert quantitative color scheme, that you can use to apply the domain change.
Reading over the linked Altair issue, this should be doable by just adding in a "sort" attribute to the Vega-Lite spec for the sample plot then regenerating it. This is in principle the same way all of the other sample plot controls work -- the main hassle here will be just doing the copypasta to make sure this is tested, etc.
My understanding of the Altair issue was that ‘domain=[1, 0]’ reversed the color scale, whereas “sort” inverts the quantitative values (e.g., blue remains “top” of color scale, but now 30 is the lowest value and 20 is the highest value). So the difference is in whether your color scale or your values are inverted.
To me it makes more sense to invert the color scale if that’s what you want, as opposed to the sorting your values around the color scale you want. That being said, I think each approach has different implications for future extensibility.
It would be awesome if color schemes could be inverted, e.g.,
from the red sea example. In the picture, I am using
redblue
color scheme, but due to ordering, colder temperatures are red and warmer temperatures are blue, which is a little counter-intuitive and it would theoretically be nice to display the legend with the opposite color ordering. There is nobluered
color scheme in vega-lite, so in order to get the color scheme inverted, you have to invert the upper and lower bound of the domain, something like addingdomain=[1, 0]
to the scale call:qurro/qurro/generate.py
Line 289 in a37037b
I think user-side, this would look something like having a checkbox titled
Invert quantitative color scheme
, that you can use to apply the domain change.This issue vega/altair#1068 may be informative
The text was updated successfully, but these errors were encountered: