フィルターのクリア

How do I edit this bar graph? Y-axis thickness and ticks

3 ビュー (過去 30 日間)
MJ
MJ 2021 年 6 月 9 日
コメント済み: Star Strider 2021 年 6 月 9 日
How do I make the y-axis (in the middle) thicker?
Also, how do I get rid of ticks on the right side and add them to the y-axis (the middle)? (Maybe right side of the first group, left side of second group, etc.)

採用された回答

Star Strider
Star Strider 2021 年 6 月 9 日
See if the YAxisLocation and other Axis Properties and Numeric Ruler properties will do what you want.
  2 件のコメント
MJ
MJ 2021 年 6 月 9 日
For some reason, ax.YAxis.LineWidth only affects the vertical lines on the side (i.e. the box) instead of the Y-axis itself
Star Strider
Star Strider 2021 年 6 月 9 日
I did not realise that. I did not experiment with it since I thought the location property would have the properties go with it. (The properties need a bit of tweaking, since they can interact in unexpected ways.) Otherwise, to produce a thick line at the centre origin, use the xline function. That would only make the line thicker, not the ticks. Those would likely have to be drawn individually as well, using something like this:
figure
plot([-1 1]*0.02, [0 0]+(0:0.1:1).', '-k', 'LineWidth',2)
xline(0,'-k','LineWidth',2)
Ax = gca;
Ax.YAxisLocation = 'origin';
axis([-1 1 0 1])
That simply overplots the axis. The tick values should remain, and do not need to be changed unless you want to change them.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by