How to fixed the axis order in hist3 plot?
Afficher commentaires plus anciens
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.

Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Graphics Objects dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

