PlotYY X axis doubled
古いコメントを表示
Hello,
Can someone please let me know how can avoid to have the X axis doubled when i use the command PlotYY ?
I use PlotYY to plot two curves that have a different Y axis for each one, and the same X axis.
So my problem, is that the X axis appears twice in the graph, and then it is hard to read the X graduation.
Best,
Anas
回答 (3 件)
Zhongxian pan
2013 年 8 月 19 日
1 投票
linkaxes(AX,'x');
set(AX(2),'XTickLabel',[]);
Leah
2013 年 6 月 25 日
you can turn it off by then you won't know if your xaxis consistent for each y axis. it's best to make them match
turn off (not advised)
[AX,H1,H2] = plotyy(...);
set(AX(2),'xticklab',[],'xtick',[])
make match
set(AX(2),'xtick',get(AX(1),'xtick'),'xticklab',get(AX(1),'xticklab'))
3 件のコメント
ACHOURI ANAS
2013 年 6 月 25 日
Leah
2013 年 6 月 25 日
the horizontal line or the tick marks?
ACHOURI ANAS
2013 年 6 月 26 日
Tom
2013 年 6 月 25 日
Moving one x axis to the top might make things clearer
AX = plotyy(...);
set(AX(2),'XAxisLocation','Top')
3 件のコメント
ACHOURI ANAS
2013 年 6 月 25 日
Tom
2013 年 6 月 25 日
You can, though it might start to go off the top of the figure, so then you'd need to move the axes down (basically, it might get messy).
Try:
set(AX(2),'XAxisLocation','Top')
hTitle = title(AX(2),'Title String');
Pos = get(hTitle,'Position');
Pos(2) = Pos(2)*1.02; %increase the height by 2%
set(hTitle,'Position',Pos)
ACHOURI ANAS
2013 年 6 月 26 日
カテゴリ
ヘルプ センター および File Exchange で Axis Labels についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!