Drawing the x-axis at y=0

430 ビュー (過去 30 日間)
David
David 2011 年 11 月 4 日
編集済み: Walter Roberson 2021 年 5 月 1 日
Hello. At least as the default option, MATLAB draws the x-axis at the bottom-most part of the graph. However, I would like to draw it at y=0 as is a common convention. Is it possible in MATLAB? (including the scale on the axis, and replacing the default axis drawn at the bottom)
Thanks, David

回答 (4 件)

Amith Kamath
Amith Kamath 2011 年 11 月 4 日

Jan
Jan 2011 年 11 月 4 日
Further solutions:
It is always a good idea to search in the FEX.

Meade
Meade 2017 年 1 月 18 日
For posterity, this has been fixed in the HG2 Update. Linked below since this thread is currently the top search result on the topic.
  2 件のコメント

サインインしてコメントする。


Brian Russell
Brian Russell 2021 年 4 月 30 日
if all you want is dark axes on your plot at x = 0 and y = 0 you just need the commands xline(0) and yline(0). This question is all over MATLAB Central and everybody gives a more complicated solution. Maybe i don't understand the question!
  1 件のコメント
Walter Roberson
Walter Roberson 2021 年 5 月 1 日
xline() and yline() are new as of R2018b; a lot of the other replies are dealing with older releases.

サインインしてコメントする。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by