Avoid overlapping yticks, controlling Placement of yticks

조회 수: 8 (최근 30일)
Tor Aarskog
Tor Aarskog 2020년 6월 16일
댓글: DGM 2021년 12월 23일
Hello. Im trying to control the placement on the yticks seen in the figure below. I need to have a large fontsize as it should be visble in a report. Is there anyway of dragging the ytick dates, with a line showing its designation. Alternativly, increase the distance between to yticks ?
Thank you in advance.
  댓글 수: 1
Michael Soskind
Michael Soskind 2020년 6월 16일
Hi Tor. I would advise taking a look at yticks and yticklabels. yticks should allow you to set arbitrarily spaced values, and yticklabels should enable arbitrarily annotated labels. I would advise to make yticklabels the desired labels as you show in the figure, while using any spacing you like (possibly linear spacing) for yticks.

댓글을 달려면 로그인하십시오.

채택된 답변

Tor Aarskog
Tor Aarskog 2020년 6월 16일
I cirumvented the issue by greating a new vector for y with increased distance between ticks. Used yticklabels with a string vector corresponding to dates.
Could not find anything about arbitrarily changing yticklabels position.
  댓글 수: 1
DGM
DGM 2021년 12월 23일
For what it's worth, this answer solves the problem by way of color-coded annotations instead of ticklabels. The color-coding helps with clarity for adjacent lines.
That said, dealing with annotation objects can be quite convoluted and frustrating, so I don't fault anyone for avoiding this suggestion. It looks nice, though.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by