Connect datapoints in Plot
20 ビュー (過去 30 日間)
古いコメントを表示
Hi there
so i have a Dataset which I'm plotting. Now i wanna try to connect the single datapoints with a line so it's more of a graph than just single points.
I found the function line(); in another post.
Is there a mistake in my code or can I not use it this way ?
Or are there any other better fitting solutiouns to this ?
So far this is my code:
daten = readtable("datasetexperiment1.csv");
scatter(datasetexperiment1,"Times","vms");
line("Times","vms",'LineStyle','-');
Thanks ahead
Pascal
0 件のコメント
採用された回答
Dave B
2021 年 10 月 19 日
編集済み: Dave B
2021 年 10 月 19 日
Unfortunately, not all plotting functions accept table variables in MATLAB yet (scatter was one of the first of the 'traditional' plotting functions that we added table support to in R2021b).
So for the time being, you can use plot (I strongly recommend that over line), but you'll need to specify the values rather than the table variables. Your code would look like:
daten = readtable("datasetexperiment1.csv");
scatter(daten,"Times","vms");
hold on
plot(daten.Times, daten.vms);
Note that plot can also include markers, so you could just do:
daten = readtable("datasetexperiment1.csv");
plot(daten.Times, daten.vms,'-o');
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Axis Labels についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!