Add line to scatter plot markers

10 visualizaciones (últimos 30 días)
Sara Loren
Sara Loren el 1 de En. de 2021
Editada: Cris LaPierre el 1 de En. de 2021
I want to connect the scatterplot markers using lines that follow the same colormap. Any leads on how to do this? Code is given below
size = 2;
c = linspace(1,12,length(x));
scatter3(x,y,z,size,c,'filled')
  4 comentarios
Sara Loren
Sara Loren el 1 de En. de 2021
hows waterfall going to help? i have tried using plot3 but unable to color coordinate the values with the colormap.
Cris LaPierre
Cris LaPierre el 1 de En. de 2021
Editada: Cris LaPierre el 1 de En. de 2021
Understood, but without your x,y, and z, we can't run your code. It leaves us unable to address your specific issue. We are therefore left making general suggestions that may or may not apply to you.

Iniciar sesión para comentar.

Respuestas (1)

Cris LaPierre
Cris LaPierre el 1 de En. de 2021
Editada: Cris LaPierre el 1 de En. de 2021
MATLAB will treat each column of data as a different series. You could reshape X,Y and Z so that the rows represent the hours of the day, and the columns represent the day of the year. Then, plotting using plot3 will automatically make each column (day) a separate line with a different color.
The default settings won't have enough colors for each day of the year. You can specify your own colors, and use the colororder function to define a unique color for each line.
I posted a working example with the dataset you shared in your original post.

Categorías

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

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by