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 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