How do i set the axis labels to a specific size?

4 ビュー (過去 30 日間)
Emily Smith
Emily Smith 2016 年 10 月 5 日
編集済み: Marc Jakobi 2016 年 10 月 5 日
I would really like to set the axis in centimeters. The main problem is that my figure is off scale when i change the size of the window. i want to set the axis tickmarks so they have a specific length value and wont change length if the size of the window is changed.

回答 (1 件)

Marc Jakobi
Marc Jakobi 2016 年 10 月 5 日
Try playing around with the XTick and YTick properties in the axes.
You can save the XTick and YTick after creating the figure:
ax = gca;
xt = ax.XTick;
yt = ax.YTick;
after resizing the figure, you can set
ax.XTick = xt;
ax.YTick = yt;
to keep the ticks of the original figure.
  2 件のコメント
Emily Smith
Emily Smith 2016 年 10 月 5 日
does that change the length as well? or does it just label the tick marks?
Marc Jakobi
Marc Jakobi 2016 年 10 月 5 日
編集済み: Marc Jakobi 2016 年 10 月 5 日
XTick and YTick change the labels and the distance between ticks. You can set the length with the TickLength property.

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

カテゴリ

Help Center および File ExchangeGrid Lines, Tick Values, and Labels についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by