Conditional plotting for a dataset?
显示 更早的评论
I would like to make a plot of data where the date is on the x-axis and air concentrations values are in the y-axis. But, I only want to plot the air concentrations that are greater than 0.07. How would I do this?
Thank you.
5 个评论
Osama Hussein
2017-11-13
Let's store air concentrations in vector "c".. Then
plot(data(c>0.07),c(c>0.07))
Walter Roberson
2017-11-13
This will join across the gaps.
Osama Hussein
2017-11-13
Yes, you are correct. Thank you.
Navonil Sarkar
2021-3-2
编辑:Navonil Sarkar
2021-3-2
I want to plot x (independent variable) vs y only for integral values of x in a discrete function! How can this be done?
Walter Roberson
2021-3-2
temp = x;
temp(mod(temp, 1)~=0) = nan;
plot(temp, y)
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!