-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Color maps could look better #238
Comments
@lee1043 in order to have vcs revert to the vcs.utils.defaultColorsRange = range(16,240) At the begining of your script that should solve the issue for you |
@lee1043 this is great, thanks for kicking this off.. I've been begging for this for a while CDAT/cdat#906 and #98 There seems to be quite a large number of dupes in the #238 (comment) above, so It also seems to be missing a large number of the palettes that @chaosphere2112 managed to find back in CDAT/cdat#1345 (comment), from @chaosphere2112's stuff, I also noted how many unique matplotlib colormaps were available, see CDAT/cdat#1345 (comment), plus all the additional colormaps that I provided through to @chaosphere2112 in CDAT/cdat#1345 (comment) (the bottom right thicker panels) which can be found in the file https://github.com/durack1/durolib/blob/master/lib/colourLib.py Happy to iterate and tweak these alongside you.. And so we have everything in one place.. The matplotlib colormaps: |
Thanks @lee1043 for the useful script! Some version of it would be useful in the gallery Several color related questions for @doutriaux1 et al:
I have recently heard about a useful set of colormaps, with a matching nice documentation: http://matplotlib.org/cmocean/ |
import vcs
gm = vcs.createisofill()
gm.colormap = "rainbow"
levels = [1,2,3,4,5]
colors = vcs.getcolors(levels,colors=range(255,-1,-1))
gm.fillareacolors=colors
import vcs
x=vcs.init()
gm=vcs.createisofill()
# First way setting colormap at vcs level
vcs._colorMap = "viridis"
# Second way at the canvas level
x.setcolormap("inferno") # superseeds vcs colormap
# Third way at gm level
gm.colormap = "plasma" # superseeds canvas |
@doutriaux1 Color shrinking for some horizontal bars is not dependent to selection of color map. See below. Should be something related to EzTemplate? Weird... |
@lee1043 I think so, something in EzTemplate, althoguh template.data.x1 and template.data.x2 are constant. Sorry didn't have time to look at it yet. |
@durack1 @doutriaux1 @chaosphere2112 Maybe having matplotlib color maps in VCS related to below? vcs.colors.matplotlib2vcs https://uvcdat.llnl.gov/docs/vcs/misc/colors.html I will test it. Any comment welcome. |
@durack1 I believe below is that @chaosphere2112 was working on at CDAT/cdat#1345 (comment). Could use Plotting code: |
@lee1043 I know that if you put a trailing |
@lee1043 I worte the code to convert mpl colormap so yes you can import mpl colormap. Not sure the |
@durack1 @doutriaux1 I can load |
@doutriaux1 @durack1 friendly reminder: it would be nice if we can have matplotlib colormaps already in it when vcs is imported and initialized. |
Below are some sample figures from the set I produced for the IPCC AR4. Some of these color bars are pretty good I think. I'll also include the color table and the code used to produce these plots. (scroll down) and here's the colormap used: |
@doutriaux1 it would be great if we could pull @taylor13's colormaps into |
+1 where is the definition of @taylor13 colormaps? |
that's what your initial.attribute file is for. I'm open to stick it as part of pmp. Or make an external, separate package with a bunch of vcs templates, colormaps, graphic methods etc..., organized by project/themes. |
@durack1 I have to balance between user that want everything in the kitchen sink and those who wants a faster more efficient vcs... |
@doutriaux1 why fracture things out of Having some additional colour maps will increase the package size by KBs, and what I proposed above meant that you would ship them with the module, but not have them load with the default colour maps when |
@aashish24 see #238 (comment) above |
@durack1 because
|
@doutriaux1 btw is there a page or pdf somewhere that says what the different elements of a template are (what they are for and where there are by default on a canvas)? I know a bunch and I do trial/error otherwise but I was trying to tell a new user about templates yesterday and having something to show to the users would be nice. I have found some of your old tutorials, but none has a page that would show where the elements are (or what they are for). A bit like the template editor |
@jypeter yes there are. I need to put thme somewhere VCS TemplateTaylor diagrams |
@doutriaux1 That graphic is really helpful! Thanks for sharing. |
Visualization of @taylor13's color maps, C_pcmdi given at #238 (comment) |
As I recall the different variants on the same color map, all contained in one file are designed for different numbers of contours. It would be easier to to see this if you spread out each of the bands in the figure above, placing each on a new row (so instead of a single row, 11 color rows; and I think there are some grey scale options in slots 0-40. |
Thanks @doutriaux1 ! That's (the template objects' names) a typical example where a nice figure is better than a notebook |
@taylor13 I believe below is what you suggested. Each of the bands was stretched to have 240 color levels. Sharing below code for future reference: |
@taylor13 Thanks for clarifying what you were looking for and here it is: Plotting code: |
Nice! @doutriaux1 are the last 16 color indices still protected so that you are sure to always get the same 16 basic colors for lines, text, etc? Because I tried to use red and green (indices 253 and 254 or something like that) when using bl_to_darkred, but the colors I got were more yellow-orange, like in the middle of bl_to_darkred |
@jypeter no since |
@doutriaux1 Could you remind me what was the one single line commend to bring all matplotlib colormaps in? |
vcs.utils.loadmatplotlibcolormaps() |
@doutriaux1 Thanks! |
Some of color maps have discrete colors at both edges. Instead of using
range(16,240)
forvcs.getcolors
to avoid those edge colors, I think it would be much simple for users if we can make users no need to think about it.Below code is for making above image:
plot.py.txt
The text was updated successfully, but these errors were encountered: