How to use hold command with Plotyy and Subplot?
3 views (last 30 days)
Dear Matlab Users,
I am facing a problem on applying hold command along with both Plotyy and subplot. Here, I am providng my code and attached my sample data for your convenience. Here, the subplot consists of 4 plotyy figures with 2*2 grid, and each plotyy fig. contains 4 plots with 2 at the left Y-axis, 1 at the right Y-axis and one hline plot for the threshold value. For adding 2 plots at the left Y-axis, I am using hold (ax1(1)), hold(ax2(1)), hold(ax3(1)), and hold(ax4(1)) in the subplot 1, 2, 3, and 4 respectively. When, I am running the attached code, it is showing an error on handle axis.
Please help me to know where I am going wrong in the attached code.
Please find the attached sample data and code matfile.
Thank you for your time.
dpb on 16 Jan 2020
yline(0.15,'m','GHE = 0.5', ...
Really too many ticks for the space with subplot() unless you're going to make the display full screen, but it's what asked for...
More Answers (1)
dpb on 15 Jan 2020
Edited: dpb on 15 Jan 2020
Using the features TMW has given us more recently...in particular, datetime and yyaxis along with using some data organization by indexing will help immensely to simplify...the following code generated
I didn't bother to finish the rest of the annotation, etc., that should be simple enough to insert into the loop with some preliminaries to save the needed info for labels, etc.
The line handles and basic axis handles are all saved so can also make modifications outside the loop if necessary/desired.