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!