How to change scatter plot shapes for multiple y variables to help differentiate them?

10 ビュー (過去 30 日間)
Hello,
I am new to coding and managed to get this far. I am trying to clean up this plot a little and help differentiate the y axis variables(Gain,PAE,PLRF_dBm). I can not seem to figure out how to change the shapes of the y variables. Any help would be greatly appeciated. I have read everything I could find but nothing works if I have more than one variable. Thanks!
Pswpdata = readtable('csv_file.csv');
scatter(Pswpdata,'Frequency',{'Gain','PAE','PLRF_dBm'},'filled')
legend
title('GT,PAE & Pout (dB)')

採用された回答

Mario Malic
Mario Malic 2023 年 10 月 12 日
編集済み: Mario Malic 2023 年 10 月 12 日
You can check outboxchart too, It might be a little confusing at first, but this makes a clearer comparison. You'll need a newer version of MATLAB, I don't know when GroupByColor is introduced.
I think this bar example could be a better approach but I think you would have to restructure your data a bit https://uk.mathworks.com/help/matlab/ref/bar.html#bug9u7m-1
Pswpdata = readtable('csv_file.csv');
numVars = 3;
numElements = numel(Pswpdata.Gain);
varNames = ["Gain", "PAE", "PLRF_dBm"];
varNames = repmat(varNames, [numElements, 1]);
varNames = reshape(varNames, [], 1);
cats = categorical(Pswpdata.Frequency);
cats = repmat(cats, [1, numVars]);
cats = reshape(cats, [], 1);
data = reshape([Pswpdata.Gain, Pswpdata.PAE, Pswpdata.PLRF_dBm], [], 1);
boxchart(cats, data, "GroupByColor", varNames)
grid on
legend
title('GT,PAE & Pout (dB)')

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by