how to plot from a 60dimension array in one figure.
显示 更早的评论
Hi, I have a Array 1989 x 4 x 60 each dimension containing spectra measurments. now I want to plot all in on figure with: figure1=figure hold on x = AmplitudeArray(:,1,1) for i=1:1:60 y = AmplitudeArray(:,4,i) plot (x,y) end
unfortunately this results in only 5 spectra to be plotted instead of the 60 I need.
3 个评论
Adam
2018-7-16
Are there literally 5 line objects parented by the axes in the figure or do you mean you can only see 5 distinct lines?
Eddy van der Goot
2018-7-16
Some diagnostics to try
- Scroll through values of the array to make sure the values make sense and are in the expected ranges. Are they all NaN, inf, -inf, etc?
- Step through your for-loop in debug mode and see each set of data updated on the plot. If you don't see an update, look at those x,y values to determine why.
- Are you limiting your axis ranges (xlim, ylim) such that only some of your data are visible?
- Is your for-loop actually executing 60 times?
- Is the size of your array the size that you expect?
- Are some of your data much greater in value than other data such that the axes are being collapsed and smaller data becomes invisible?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!