Different color scale?
显示 更早的评论
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 个评论
Rik
2024-11-25
What did you try so far?
Mathieu NOE
2024-11-25
hello @Ara
it would help us (and you BTW) if you could share a working code and the data
all the best
Ara
2024-11-26
回答(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 个评论
Ara
2024-11-26
Image Analyst
2024-11-26
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
2024-11-27
Walter Roberson
2024-11-25
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 个评论
Ara
2024-11-26
Rik
2024-11-26
You're aware you didn't set a colormap for ax2?
Ara
2024-11-26
DGM
2024-12-2
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
2024-12-3
编辑:Image Analyst
2024-12-3
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
2024-12-4
Walter Roberson
2024-12-4
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
2024-12-4
Ara
2024-12-4
Ara
2024-12-7
类别
在 帮助中心 和 File Exchange 中查找有关 Vector and Raster Map Display 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!