Question

I am using matlab for plotting scatter data. I want that the figure be in the range of [0 68] for X and [0 100] for Y, but when I use the following command, the X and Y axis are not consistent. For example, I expect the vertical axis to be longer than horizontal, while matlab give me something else. Have I missed something in the figure setting?

figure, axis([0 68 0 100]); box off , scatter(y,x,100,val,'filled'); box on; 

enter image description here

Was it helpful?

Solution

It seems to be a matter of the order of commands.

x = 1:60;
y = 1/3.*x;

plot(x,y)
grid on
axis([0 60 0 20])
axis equal

will return

enter image description here

what you don't want, as it screws up your limits.

So rather use:

axis equal
axis([0 60 0 20])

and it is alright:

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top