PlotYY X axis doubled

19 views (last 30 days)
ACHOURI ANAS
ACHOURI ANAS on 25 Jun 2013
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

Answers (3)

Zhongxian pan
Zhongxian pan on 19 Aug 2013
linkaxes(AX,'x');
set(AX(2),'XTickLabel',[]);

Leah
Leah on 25 Jun 2013
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 Comments
ACHOURI ANAS
ACHOURI ANAS on 26 Jun 2013
the tick marks are not doubled anymore, but the horizontal line is still doubled at the bottom of the plot.

Sign in to comment.


Tom
Tom on 25 Jun 2013
Moving one x axis to the top might make things clearer
AX = plotyy(...);
set(AX(2),'XAxisLocation','Top')
  3 Comments
ACHOURI ANAS
ACHOURI ANAS on 26 Jun 2013
ok, thank you very much

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by