Incorrect autoscaling during plot command in matlab
古いコメントを表示
Hello guys, first time poster. I just had a question about my code- I am just trying to plot some data that I imported from a csv file, but the plot itself leaves voids.
I haven't done anything to change the settings.
The code:
clear all; close all; clc
t = load('sampledata.csv');
time=t(1:125000,1);
gage=t(1:125000,2);
plot(time,gage)
xlabel('Sample Number')
ylabel('volts')
title('{\bf Oscilloscope Data}')
any help or advice will be appreciated. thanks!
sam

5 件のコメント
Fangjun Jiang
2011 年 9 月 26 日
What do you mean "the plot itself leaves voids"?
Jan
2011 年 9 月 26 日
For "clear all" see this: http://www.mathworks.com/matlabcentral/answers/16484-good-programming-practice#answer_22301
Congratulations: You are a first time poster *and* formatted the code correctly *and* embedded a picture instead of posting just a link to it. Although I did not understand what the problem is, the layout is excellent. Therefore this is my personal *question of the week*. +1
Walter Roberson
2011 年 9 月 26 日
@Jan: I reformatted the post and embedded the image...
Samuel
2011 年 9 月 30 日
Walter Roberson
2011 年 10 月 2 日
To embed an image, use a separate paragraph and start it with << followed immediately (no space after << ) by the URL to the image directly, followed immediately (no space after URL) by >>
The tricky part is often in finding the direct URL for the image, especially if you do not have an account on the system being used to host the image. For situations like that, I display the image in my browser, position my cursor over it, right-click, and choose "Copy image location". That URL is then the one I paste in to the posting.
回答 (2 件)
Bjorn Gustavsson
2011 年 9 月 26 日
That figure looks OK to me I guess. "Guess" since I dont know what your data going in was...
What points are you missing?
Do you want a tighter fit of the plot around the points? Then you should could do:
axis tight
Beside that not much to go on here.
HTH
4 件のコメント
Jan
2011 年 9 月 26 日
I do not understand what should be wrong with the diagram also.
Walter Roberson
2011 年 9 月 26 日
Perhaps the OP is not expecting the straight line of -10 values ?
Or perhaps the OP is expecting a solid outline instead of the high-frequency hopping?
Or perhaps the OP is referring to the parts that sort of look like black "diamonds"? Those might be seen as "holes", especially since there is no apparent reason for them to appear black instead of blue ?
Samuel
2011 年 9 月 30 日
Fangjun Jiang
2011 年 9 月 30 日
axis([XMIN XMAX YMIN YMAX])
Samuel
2011 年 9 月 30 日
0 投票
2 件のコメント
Walter Roberson
2011 年 9 月 30 日
set(gca, 'Xlim', [min(time),max(time)], 'YLim', [min(gage),max(gage)])
Samuel
2011 年 10 月 1 日
カテゴリ
ヘルプ センター および File Exchange で Image Arithmetic についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!