How can I put the axis origin in the middle of the plot?
Mostra commenti meno recenti
Hello. I try to do changing the origen of axis to the center of the plot. I have written in matlab:
ax = gca;
ax.XAxisLocation = 'origin';
ax.YAxisLocation = 'origin';
Matlab say: While setting the 'XAxisLocation' property of Axes: 'origin' is not a valid value. Use one of these values: 'bottom' | 'top'.
How can I put the axis origin in the middle of the plot?
I am very grateful if someone can help me Best regards, MJ
Risposta accettata
Più risposte (1)
xin xu
il 15 Nov 2020
I get a solution, try to use "axis(limits);" command.
For example, I want to plot a line from (-100, 100) to (50, -150). Since abs(-100) > abs(50), set XAxisLocation from -100 to 100. And this also applies to YAxisLocation.
So, add this command into matlab:
axis([-100 100 -150 150]);
Categorie
Scopri di più su Axis Labels in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!