Is there a way to select a good color scheme for easy figure viewing

I have timeseries data from nine depths under water. I was to plot it together and still be able to discriminate depth. Right now I have defined colors across the jet colormap using this line set(h, {'color'}, num2cell(colors, 2)) after defining colors as n = size(PK.mab,1);
colors = flipud(jet(n)); where n=9. This works ok except that the middle colors (yellow, cyan, light green) are difficult to decipher in the resultant figure. Does anyone have a better suggestion for a different colormap or something else? I want the colors to look nice together and make sense with depth (right now I use "cooler" colors (blues) for deep water and "warmer" colors (reds) for shallow water). Any ideas welcome! THANK YOU!
I have included a section of my current plots in the screenshot attached.

 Risposta accettata

Stephen23
Stephen23 il 10 Ott 2019
Modificato: Stephen23 il 10 Ott 2019
Do NOT use jet ! Read these to know why:
etc.
"Does anyone have a better suggestion for a different colormap or something else?"
Firstly you need to know if your data are sequential or qualitative:
  1. sequential data means that the relative order of the data is significant. This incudes most physical phenonema, e.g. velocities, sizes, weights, etc. These are typically used in surface plots, etc., by setting the colormap.
  2. qualitative data are where the order is not significant, e.g. test subjects, etc.. Typically created via plot as separate lines, and the color is controlled by the axes line ColorOrder property.
Once you are certain if your data is sequential or quantitative, then selecting colormap is easy. A good place to start is by using Cynthia Brewer's colormaps, e.g. my FEX submission:
Or you can search on FEX for suitable colormaps:
You will even find some that are specifically designed for depths similar to what you describe, e.g.:
Not that to use FEX submissions they need to be downloaded and unzipped onto the MATLAB Search Path, or simply into the current directory.

5 Commenti

Not that to use FEX submissions they need to be downloaded and unzipped onto the MATLAB Search Path, or simply into the current directory.
Or they need to be installed using Get Add-Ons under the Add-Ons icon in the Environment section on the Home tab of the Toolstrip.
Though for the crameri suggestion you made, it looks like the actual files are in a subdirectory of the directory that the Add-On process adds to the MATLAB path, so you'd need to add that subdirectory to the MATLAB path before using it. But you can using Add-On Explorer to have MATLAB cd to the folder that has that subdirectory, making it a bit easier to add it to the path.
Thank you both! This is so helpful! I'm wondering how to implement one of these new color schemes in my current definition of the n=9 colors. For instance, if I want to try the cmocean 'thermal' colormap how would I replace my line: colors = flipud(jet(n));
"if I want to try the cmocean 'thermal' colormap how would I replace ..."
Following the cmocean instructions:
colors = cmocean('thermal',9);
ooh I was close! I just didn't know where the 9 went. Thanks!
Do I need to adjust my line to set the colors as well? This is what I was doing before:
set(h, {'color'}, num2cell(colors, 2));
"I just didn't know where the 9 went"
I also didn't know, but reading the cmocean documentation gave the required information.
"Do I need to adjust my line to set the colors as well?"
The rest of your code should work just the same.

Accedi per commentare.

Più risposte (0)

Categorie

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by