Plots disappear when I change y-limit
3 views (last 30 days)
Show older comments
Edit: Never mind. I realized after posting this, said figure isn't 9 'plot' commands. It's 9 'plot3' commands each figure viewed from [0 0]. As such, zlim should have been used to change the range. I will point out that 'plot3' appears to be one of the few commands that won't take an axes handle as an overload to the first input.
Original text below:
I created a figure with 9 subplots each of which is made of 4 curves created using the 'hold on' command. I've saved the figure and uploaded it. When I perform the following commands on the original plot or on the saved figure I get the same results.
I did not erase the box around the plots in my plotting commands so obviously something is wrong in the way this plot is made but it's not something different from what I've done before. Can anyone tell what's wrong with my figure such that I can fix my code?
I'm running MATLAB 2017b on Windows 10, x64
Thanks in advance.
subplot(331)
ylim([0 3e-6]); % does nothing
subplot(332)
ylim([0 3e-6]); % erases the contents of the axis same for subplots 3-9
1 Comment
Steven Lord
on 5 Apr 2018
"I will point out that 'plot3' appears to be one of the few commands that won't take an axes handle as an overload to the first input."
According to the documentation plot3 does accept an axes handle as the first input argument to control on which axes the line is created. See line 4 in the Syntax section.
If you have a situation where that doesn't seem to work, please post a small segment of the code that demonstrates that situation (along with any error or warning messages you received) and we may be able to help you figure out why you're seeing that behavior.
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Subplots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!