how to move label from axis to the center

4 ビュー (過去 30 日間)
Farshid Daryabor
Farshid Daryabor 2020 年 3 月 6 日
コメント済み: Sindar 2020 年 3 月 9 日
I want to adjust the x-label {Jan, ,Dec} at the center of axis, how can I do it. Thanks
  1 件のコメント
Ameer Hamza
Ameer Hamza 2020 年 3 月 6 日
Can you mark on the image what is your expected outcome? Where do you want to move the x-labels?

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

回答 (1 件)

Sindar
Sindar 2020 年 3 月 6 日
First, those are called the xtick labels. It turns out moving them is a pain, but I did find a potential solution here:
a=gca;
a.XRuler.TickLabelGapOffset = -45;
  2 件のコメント
Farshid Daryabor
Farshid Daryabor 2020 年 3 月 9 日
By this comment text shift up and down, whilst I want to shift text to the center without shift of axis, for instance,
| | | |
Jan Feb Mar
| | |
Jan Feb Mar
Sindar
Sindar 2020 年 3 月 9 日
A better way to phrase your question is:
How do I move the xtick labels to midway between xticks?
My immediate response would be: don't. Doing this is confusing.
However, if you feel you must, there are many answers here on how to manually set the location and text of ticklabels using the text() command

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

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by