plot many columns to different figure
古いコメントを表示
Hello! I have 2004 columns of data. I want to plot the first column (X) with all others (Y). i.e.: plot(X,Y1) plot(X,Y2) . . . plot(X,Y2004)
If I do this and run the program, I take one figure only with the first plot. If I write plot(X, Y(:,1:2004)), I take one figure with 2003 lines. I don't want this. I want to take 2003 figures which are X,Y1, the other figure will be X,Y2 and so on. Also, I would like to do this in one step.
Is there an idea?
Thank you for your help.
採用された回答
その他の回答 (4 件)
Image Analyst
2014 年 9 月 6 日
There is no way you're going to see 2002 plots of data unless you have a very large monitor. I would not use bar charts, line/curves, ribbon plots or anything like that. I'd display it as an image. Even then, unless you have more than 2003 pixels across, you're not going to see all the columns. I'm not sure what your x is but assuming that the x's are linearly spaced and increasing, I'd just display the y as an image:
image(Y(:,2:end));
Apply a colormap if you want
colormap(jet(256)); % Or gray(256)
colorbar;
If your monitor is not 2003 columns across, MATLAB will shrink the image down so that it fits on the screen, though you can zoom it up to the original size if you want. So each column is a line of pixels on your monitor. No other type of display (ribbons, or other 3D-like graphics) will fit - you won't see them unless you are zoomed in so much that you then won't see the entire data set at the same time.
The other option is to use plot() with a different color for each column and plot everything on one axes. Of course they'll all pile on top of each other but it will let you see the average (i.e., the band of curves where the bulk of the curves lie) and outlier curves. In fact you might plot the average over the mess of lines in a thicker line in a color like red so you can see it. But I think an image is better, particularly if there is some relationship/correlation between nearby columns.
1 件のコメント
Image Analyst
2014 年 9 月 8 日
I'm not sure what you did. Did you use plot() or ribbon() as Star suggested, or an image like I suggested? Who are you replying to? I'm not sure what kind of BMP image you want. Can you show us a screenshot of what you're starting with? With my suggestion you'd already have an image, but I don't know what you mean by doing a "linear fitting". Fitting of what to a line?
2 件のコメント
Star Strider
2014 年 9 月 9 日
@Fani — I outlined a way to do what you want in my comment to my Answer yesterday. What about that did not work?
カテゴリ
ヘルプ センター および File Exchange で Exploration and Visualization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
