Two colormaps on map projection
6 次查看(过去 30 天)
显示 更早的评论
Hi
I would like to create a map projections
load coast
figure('units','normalized','outerposition',[0 0 1 1], 'Color','w');
worldmap([30, 90], [-180, 180])
plotm(lat, long, 'k', 'LineWidth', 1.4);
With a two different data-sets on it (using scatterm). I have attached two data-sets "A" and "B".
hold on;
scatterm(A(:,1), A(:,2), 100, A(:,3), 'filled');
c = colorbar;
colormap jet
c.Label.String = 'Magnetic field in Z [nT]';
scatterm(B(:,1), B(:,2), 100, B(:,3), 'filled', 's');
But I need a second colormap and colorbar. I did find ways to do this, by making a new XY-axis and making it invisible. But this is not possible with map projections.
Thanks in advance.
3 个评论
Walter Roberson
2018-6-13
Ah yes, you hit a bug in freezeColors for hg2. I emailed a detailed description of the problem to the author back in March but I did not receive a reply.
回答(1 个)
Walter Roberson
2018-6-13
load coast
figure('units','normalized','outerposition',[0 0 1 1], 'Color','w');
worldmap([30, 90], [-180, 180])
plotm(lat, long, 'k', 'LineWidth', 1.4);
hold on
cmapA = jet;
Acolor = squeeze(ind2rgb(im2uint8(mat2gray(A(:,3))),cmapA));
scatterm(A(:,1), A(:,2), 100, Acolor, 'filled');
caxis([min(A(:,3)),max(A(:,3))]);
cA = colorbar('westoutside');
cA.Label.String = 'Magnetic field in Z [nT]';
cA.Colormap = cmapA;
cA.LimitsMode = 'manual';
cmapB = copper;
Bcolor = squeeze(ind2rgb(im2uint8(mat2gray(B(:,3))),cmapB));
scatterm(B(:,1), B(:,2), 100, Bcolor, 'filled', 's');
caxis([min(B(:,3)),max(B(:,3))]);
cB = colorbar('eastoutside');
cB.Label.String = 'Orgone energy in bions';
cB.Colormap = cmapB;
cB.LimitsMode = 'manual';
hold off
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Orange 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!