Closed CoraBora closed 7 months ago
I am not sure that Matlab has a build in function for this (unlike Python -> Matplotlib). A quick search found this on the Matlab file exchange https://uk.mathworks.com/matlabcentral/fileexchange/47151-fill_between which would seem to do what you want. You can of course customise the existing plot should you wish rather than having to create a new plot from scratch. Regards Mark
I am trying to generate a similar plot with my own features. How can I color the significant areas? I only manage to color the entire area between the curve and the threshold. I have tried many different options but unfortunately I can't find the solution. I have already asked in the general Matlab forum but I didn't get any further there either.
This is my code:
curve = F(:,2)'; line = 13; plot(curve,'k'); hold on; area(x,curve,line,'FaceColor','c','LineWidth',1); yline(line, '--r',LineWidth=2)
This is how it should look (only the shaded areas):