Value in x-axis and y-axis not display same as data

x-axis should be display value of latitude and y-axis should be display the value of longitude. but when im run GUI with this coding;
table=get(handles.uitable5,'Data'); X=table(:,1); Y=table(:,2); Z=table(:,3);
pointsize = 20; scatter(X, Y, pointsize, Z); colormap([1 0 0; 0 1 0]); %red, green axes(handles.axes1);
the result is like image below which x-axis was display by the value 1,1.002,1.004,1.006,1.008,1.01 and y-axis was display by the value 1,1.0005,1.001,1.0015,1.002,1.0025,1.003.

 Réponse acceptée

Stephen23
Stephen23 le 21 Juin 2015
Modifié(e) : Stephen23 le 21 Juin 2015
Actually those values are exactly the same as the data, except that the GUI arrangement obscures the exponential multiplier. Here is a scatter plot with some of those data points, showing the exponential multipliers (highlighted in red):
>> X = [10000;10020;10100];
>> Y = [10000;10010;10020];
>> scatter(X,Y)
Two Solutions
  • arrange the GUI so that the exponential multipliers are visible.
  • manually set the tick label strings, something like this:
>> fun = @(ax)arrayfun(@(n){sprintf('%.0f',n)},get(gca,sprintf('%sTick',ax)));
>> set(gca,'XTickLabel',fun('X'))
>> set(gca,'YTickLabel',fun('Y'))

Plus de réponses (0)

Catégories

En savoir plus sur Color and Styling dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by