Different color scale?
Show older comments
Dear all,
I have two different dataset one in txt format (ROTI output) and another in xlsx format(S4 output).I wanted to plot different scalebar with different color so that I can recognize these two data set. Would you please tell me the command of it?
Thank you,
Aramesh
4 Comments
Rik
on 25 Nov 2024
What did you try so far?
Mathieu NOE
on 25 Nov 2024
hello @Ara
it would help us (and you BTW) if you could share a working code and the data
all the best
Ara
on 26 Nov 2024
Answers (2)
You need to use the colormap function to set the colormap for each axes independently. So display one image, set the colormap, then display the other and call colormap again with the other colormap. If you're plotting line curves instead of displaying images, there is a 'Color' (or maybe 'LineColor' option in plot to let you set the specific color of each curve.
help colormap
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
3 Comments
Ara
on 26 Nov 2024
Image Analyst
on 26 Nov 2024
I don't know what you want. What color ranges do you want for the left colorbar and right colorbar, and what numerical data values do the top and bottom of the colorbars represent?
Ara
on 27 Nov 2024
Walter Roberson
on 25 Nov 2024
caxis([0 0.3]);
That is affecting the current axis.
caxis([0 0.5]);
That too is affecting the current axis. Which appears to be the same axis as before.
Each axis has only one CLim axis property, so only one caxis() can be in effect at the same time in each axis.
If you need two different caxis() then you need two different axes.
14 Comments
Ara
on 26 Nov 2024
Rik
on 26 Nov 2024
You're aware you didn't set a colormap for ax2?
Ara
on 26 Nov 2024
DGM
on 2 Dec 2024
If you're dealing with multiple axes, you should be explicitly specifying which axes colormap()/clim() are operating on. You had that before, but I don't know why you don't have it specified now.
Image Analyst
on 3 Dec 2024
Edited: Image Analyst
on 3 Dec 2024
It would be easier for us to reproduce and debug if you gave us a small working example, instead of an unrunnable snippet. And include screenshots of what you are getting, and if possible (mock something up in Photoshop), what you'd like to get.
Ara
on 4 Dec 2024
Walter Roberson
on 4 Dec 2024
colormap(ax1, parula);
caxis(ax1, [0 0.3]);
c1 = colorbar(ax1, 'Location', 'eastoutside');
c1.Label.String = 'S4';
% Create world map for ROTI
ax2 = worldmap(latlim, lonlim);
setm(ax2, 'FFaceColor', 'none'); % Keep background transparent
hold on;
idx = filtered_time_hours_all >= (i-1)*5/60 & filtered_time_hours_all < i*5/60;
if any(idx)
scatterm(ax2, all_lat(idx), all_lon(idx), ...
10, all_roti(idx), ...
'filled', 'Marker', 's', 'MarkerFaceAlpha', 0.6);
end
colormap(ax2, parula);
caxis(ax2, [0 0.5]);
c2 = colorbar(ax2, 'Location', 'westoutside');
c2.Label.String = 'ROTI (TECU/min)';
Ara
on 4 Dec 2024
Ara
on 4 Dec 2024
Ara
on 7 Dec 2024
Categories
Find more on Vector and Raster Map Display 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!