how to move label from axis to the center

11 views (last 30 days)
Farshid Daryabor
Farshid Daryabor on 6 Mar 2020
Commented: Sindar on 9 Mar 2020
I want to adjust the x-label {Jan, ,Dec} at the center of axis, how can I do it. Thanks
  1 Comment
Ameer Hamza
Ameer Hamza on 6 Mar 2020
Can you mark on the image what is your expected outcome? Where do you want to move the x-labels?

Sign in to comment.

Answers (1)

Sindar on 6 Mar 2020
First, those are called the xtick labels. It turns out moving them is a pain, but I did find a potential solution here:
a.XRuler.TickLabelGapOffset = -45;
Sindar on 9 Mar 2020
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

Sign in to comment.


Community Treasure Hunt

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

Start Hunting!

Translated by