2 XTick are existing on one plot!

I'm trying to change the x ticks on a plotyy(x,y1,x,y2). This is what I'm doing:
set(gca,'XTick',[0:4:64])
However, the plotyy wants to use something more like [0:10:70], so I am getting my 0:4:64 ticks, but they are just being overlaid over the default ticks. Basically it's just really hard to read and the default ticks do not work for my application.

 採用された回答

Jan
Jan 2012 年 7 月 18 日

0 投票

plotyy creates two axes objects. So do not use gca but the handles replied by AX = plotyy().

1 件のコメント

Aimie
Aimie 2012 年 7 月 27 日
I would like to comment here just to say that I thought that I could only edit the y-axes by using AX(1) and AX(2) handles. However, by using
set(AX,'XTick',[0:4:64])
I was able to set both AX axes handles to make the x-axis ticks change correctly.
Thanks!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeTwo y-axis についてさらに検索

製品

質問済み:

2012 年 7 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by