I am using R2018b. Why does my graph appear so pixelated?

1 回表示 (過去 30 日間)
Zuha Yousuf
Zuha Yousuf 2019 年 8 月 7 日
コメント済み: Adam Danz 2019 年 8 月 7 日
Both the x and y vectors are 1341*1 double.
My code is given below:
[~,NumDataS]=xlsread('Oxygen_5.14.19_Dex_vitals_001.xlsx','Sheet2','F607:G1947'); % Physiological Data
[~,TmatrixS] = xlsread('Oxygen_5.14.19_Dex_vitals_001.xlsx','Sheet2','A607:F1947'); % Time Data
HR = cellfun(@str2double, NumDataS(:,2)); % Retrieve From Cell Array Of Strings
Time1=cellfun(@str2double, TmatrixS(:,5)); %Array of minutes to be converted to seconds
Time1convert=Time1*60
Time2=cellfun(@str2double, TmatrixS(:,6)); %Array of seconds
Totaltime=Time1convert+Time2
figure
graph1=plot(Totaltime, HR)
  2 件のコメント
Luna
Luna 2019 年 8 月 7 日
Did you check your screen resolution?
Adam
Adam 2019 年 8 月 7 日
Did you check your data?
plot plots what you tell it to, and if your data is stepped you'll get a plot that looks stepped too.

サインインしてコメントする。

採用された回答

Adam Danz
Adam Danz 2019 年 8 月 7 日
編集済み: Adam Danz 2019 年 8 月 7 日
My bet is that the plot is merely showing your data. Your data appear to be integer values along the y axis so the data will always clump around interger values which may appear to be pixelated under certain viewing conditions. As a test, if you stetch out the x axis (ie, xlim([1400,1600])) you may see this step pattern better. Also, if you plot with markers and not lines (ie, plot(Totaltime, HR, 'bo')) and turn the grid on (grid on) it may also help to reveal this natural pattern in your data.
  2 件のコメント
Zuha Yousuf
Zuha Yousuf 2019 年 8 月 7 日
Thank you so much! The problem was that it was clumping around the integer values as you said. Taking a 5 second moving average worked.
Adam Danz
Adam Danz 2019 年 8 月 7 日
Glad I could help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by