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

10 visualizaciones (últimos 30 días)
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)')

Respuesta aceptada

Mario Malic
Mario Malic el 12 de Oct. de 2023
Editada: Mario Malic el 12 de Oct. de 2023
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)')

Más respuestas (0)

Categorías

Más información sobre Scatter Plots en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by