How to fixed the axis order in hist3 plot?
2 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone,
My script works well but there is only one issue, it gives vertical axis as reverse (higher to lower (46 to 45 instead of 45 to 46: Figure attached)
clear all
clc
axial_cat=readmatrix('axil_cat.csv'); % Axil catalog
axial_lat=axial_cat(:,7);
axial_long=-1*axial_cat(:,8);
data=[axial_long axial_lat];
figure;
resolution = [50, 50]; % This defines the how many bins you want 1000mm/10 = 100mm bin size
[n, q] = hist3(data, resolution);
imagesc(q{:}, n');
xlabel('length [mm]');
ylabel('length [mm]');
c = colorbar;
c.Label.String = 'Amount';
set(gca,'ColorScale','log')
Problem 2: I attempt to solve this issue with another approch. Altough the axis issues is solved by second approch but resolution is limited like 10 by 10, where i need 50 by 50;
My attempt is as below:
figure;
hist3(F,'CdataMode','auto')
xlabel('Longitude (W{\circ})')
ylabel('Latitude (N{\circ})')
xlim([-130.05 -129.95])
ylim([45.9 46])
yticks(45.9:0.05:46);
% ax=gca
% ax.yTick = 45.9:2:46;
colorbar
set(gca,'ColorScale','log')
a = colorbar;
a.Label.String = 'Event count';
view(2)
figure shows 10 by 10 resolution, how can i increase resolution in second case.
0 件のコメント
採用された回答
Star Strider
2022 年 6 月 4 日
The problem may be using imagesc.
Try
set(gca, 'YDir','normal')
x = randn(100,1);
y = randn(100,1);
data = [x y];
figure;
resolution = [50, 50]; % This defines the how many bins you want 1000mm/10 = 100mm bin size
[n, q] = hist3(data, resolution);
imagesc(q{:}, n');
figure;
resolution = [50, 50]; % This defines the how many bins you want 1000mm/10 = 100mm bin size
[n, q] = hist3(data, resolution);
imagesc(q{:}, n')
set(gca, 'YDir','normal')
.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graphics Object Programming についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!