I have a dataset of 3 columns, and 221488 columns. In the first and second column is the x and y data, the third column is the name of the series, each series consist of 1000-4000 rows. how do i plot each x and y data for each different series and different color each plot using loop?

Respuestas (1)

Guillaume
Guillaume el 12 de Jul. de 2018

0 votos

One possible way:
[group, seriesname] = findgroup(yourdataset.nameofthirdcolumn);
figure; %create figure;
hold on;
splitapply(@(x, y, g) plot(x, y, 'DisplayName', seriesname{g(1)}), yourdataset.x, yourdataset.y, group, group); %the repeat of group is intentional. 'DisplayName' assumes that series name are char arrays

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 12 de Jul. de 2018

Respondida:

el 12 de Jul. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by