Two colormaps on map projection
조회 수: 3 (최근 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에서 Red에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!