How to plot like the following scatter plot on MATLAB?

3 visualizaciones (últimos 30 días)
horizon
horizon el 6 de Jun. de 2019
Respondida: VBBV el 10 de Mayo de 2023
I created the graph on Excel, but I would like to plot the following plot on MATLAB.
Though I run the script, it returns me the error , there was no tips to fix it on the documentation.
Please let me know how to plot the scatter plot on MATLAB.
fig1.png
error
>> sample
Error using scatter (line 46)
Not enough input arguments.
Error in untitled (line 8)
scatter(data,'filled')
script
data = [11,10;10,11;9,10;20,18;10,11;11,10;10,9];
figure;
plot(data)
figure;
scatter(data,'filled')mat

Respuestas (2)

Walter Roberson
Walter Roberson el 6 de Jun. de 2019
scatter(repmat(1:size(data,1), 1, 2), data(:), 'filled')

VBBV
VBBV el 10 de Mayo de 2023
data = [11,10;10,11;9,10;20,18;10,11;11,10;10,9];
figure;
plot(data);grid
figure;
hold on
sz = 100;
scatter(1:size(data,1), data(:,1), sz,'filled')
scatter(1:size(data,1), data(:,2), sz,'filled')
grid
ylim([6 20])

Categorías

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

Etiquetas

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by