No Lines between points when plotting on ThingSpeak (Example ThingSpeak Code)
1 回表示 (過去 30 日間)
古いコメントを表示
Hello,
I am having problems with a simple 2-y-axis plot on ThingSpeak.
The measurement dots just do not get connected by a line.
Does anyone have an idea why that happens?
This is my code: (even the example ThingSpeak code)
readChannelID = [685541];
fieldID1 = [1];
fieldID2 = [2];
readAPIKey = '*************';
[data1, time1] = thingSpeakRead(readChannelID, 'Field', fieldID1, 'NumPoints', 3600, 'ReadKey', readAPIKey);
[data2, time2] = thingSpeakRead(readChannelID, 'Field', fieldID2, 'NumPoints', 3600, 'ReadKey', readAPIKey);
yyaxis left;
plot(time1, data1,'-x')
ylim([15 37])
yyaxis right;
plot(time2, data2,'-x');
ylim([0 100])
0 件のコメント
採用された回答
Vinod
2019 年 4 月 1 日
It is very likely that your data has NaN's in them. You can remove the missing entries using the RMMISSING function before plotting. Your code might look like this:
data1 = thingSpeakRead(readChannelID, 'NumPoints', 3600, 'ReadKey', readAPIKey,'OutputFormat','timetable');
cleanData1 = rmmissing(data1);
plot(cleanData1.Timestamps, cleanData1.Field1);
その他の回答 (0 件)
コミュニティ
その他の回答 ThingSpeak コミュニティ
参考
カテゴリ
Help Center および File Exchange で Visualize Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!