Effacer les filtres
Effacer les filtres

How do I seprate a plot based on a value of the y axis

2 vues (au cours des 30 derniers jours)
James Rodriguez
James Rodriguez le 9 Mar 2020
Modifié(e) : Bryan le 9 Mar 2020
I plotted a curve and needed to seperate it based on weather the y axis exceed a limit. I added a horziontal line at the limit of the y axis, to the plot of the curve. I think it matters that I used pchip and ppval to create my curve ,rather than an actual polynmial. This means when I try finding the intersect with methods such as the intersect funtion, I am returened with a blank array. I am not sure how I can get matlab to simpily just output the intersect efficently , if possible. Note splitting the array of the y values could be hard since it consists of more then 10000 values.

Réponses (1)

Bryan
Bryan le 9 Mar 2020
Modifié(e) : Bryan le 9 Mar 2020
you can get the current y axis limits using ylim, and then evaluate them to decide if you want to split the axis or not
limitvalue = 100;
if max(ylim) > limitvalue
% your code for splitting axis goes here
end

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by