Adding an x-axis changes output of graph

I'm trying to label my axis and it is changing the output of the graph. Only the xlabel is effecting it. Adding an x label doesn't effect the output of the other two graphs and if I add a label to a lower graph, it still changes the top one. I don't know what is going wrong.
Between attempts all I did was comment and uncomment xlabel('Time (s)')

 Accepted Answer

Almost all plotting-related commands in Matlab come with an overload that takes the axes handle as first argument. Use it!! Don't just rely on whatever happens to be the current axes.
xlabel( hAxes, 'Time(s)' )
will change the x label only on the axes whose handle is hAxes rather than some arbitrary axes.

More Answers (0)

Asked:

on 25 Jan 2017

Answered:

on 25 Jan 2017

Community Treasure Hunt

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

Start Hunting!