lsline shifts the yaxis upwards
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Priya
el 24 de Feb. de 2014
Comentada: Tony Ingram
el 28 de Mzo. de 2017
I am plotting four points:
x = [-0.13; -0.31; -1.07; -0.85] y = [-2.58; 5.21; -0.80 ; -1.14]
plot (x,y,'o')
x-axis and y-axis minimum and maximum should be same (both axes should have same scale) Here, -3 is minimum limit and 6 is maximum limit for both x and y axes.
I use lsline function to plot the least square fit line. Though both axes have same scale, however the y axis shifts upwards. ( -3 the minimum point on y axis shifted upwards)
Y-axes has less distance between the tick points. Please see the figure.
I don't know why? Please help.
0 comentarios
Respuesta aceptada
Paul
el 24 de Feb. de 2014
add:
axis([-3 6 -3 6],'square')
after your plot command.
7 comentarios
Paul
el 25 de Feb. de 2014
I think it's just a bug. I tried it in Matlab r2013b and it worked with just one axis command, whereas in r2012b I had the same problem as you. I think it resizes the line from the x value of the first point to the most right point.
Tony Ingram
el 28 de Mzo. de 2017
This is still happening in 2016b... how can we report this to get it fixed?
Más respuestas (0)
Ver también
Categorías
Más información sobre Scatter Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!