Can I put multiple colormaps on one figure?
6 views (last 30 days)
Show older comments
I have an image with 45 grids on it with multiple data points of 5 different classes/colors. I want to assign each grid its own individual colormap so that I can analyze it on a larger scale. I was wondering if this was possible or should I make a colormap for the whole thing and put the grids on top of that? I attached a picture for some visual clarity. Any tips or suggestions are appreciated and thank you!! ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1446702/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1446702/image.png)
2 Comments
DGM
on 31 Jul 2023
Edited: DGM
on 31 Jul 2023
To be more specific, I assume you have one image, but you have 45 groups of datapoints, and it's the datapoints you want to use with a colormap. Is that correct?
If so, what tools are you using to draw the image and datapoints. If they're stuff from the mapping toolbox, the answer might be different.
If you're trying to do something different, feel free to clarify.
Answers (2)
dpb
on 31 Jul 2023
Edited: dpb
on 31 Jul 2023
colormap doc says...
target — Target
Figure object | Axes object |PolarAxes object | GeographicAxes object | standalone visualization
Target, specified as one of these values:
- Figure object. The figure colormap affects plots for all axes within the figure.
- Axes object, PolarAxes object, or GeographicAxes object. You can define a unique colormap for the different axes within a figure.
- ...
I've not actually tried it, but says it should work just fine.
0 Comments
Chhayank Srivastava
on 31 Jul 2023
Do you have co-ordinates of the grid.
You can plot the map and plot each of the grid individually and using axis properties define colormap for each grid separately.
openExample('graphics/ColormapSpecifyAxesTiledLayoutExample')
https://www.mathworks.com/help/matlab/ref/colormap.html
0 Comments
See Also
Categories
Find more on White in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!