Borrar filtros
Borrar filtros

Set plot colour when assigned to a variable

2 visualizaciones (últimos 30 días)
William Garrett
William Garrett el 16 de Mzo. de 2020
Respondida: darova el 16 de Mzo. de 2020
I am creating a plot showing how air pollution changes in a room over time. I have a record of activity in the room and want to colour the plot according to wether there is activity (1) or no activity (0), for which I have created a logistical variable.
I have used the below code but it is plotting no activity in yellow - which is very hard to see. How do I determine my own colours when plotting colour according to a variable?
scatter(Table.Date_Time, Table.PM_Concentration, 5, Table.Activity)
  1 comentario
Ankit
Ankit el 16 de Mzo. de 2020
s = scatter(Table.Date_Time, Table.PM_Concentration, 5, Table.Activity);
s.MarkerEdgeColor = 'your color choice';
s.MarkerFaceColor = 'your color choice';
and so on..

Iniciar sesión para comentar.

Respuesta aceptada

darova
darova el 16 de Mzo. de 2020
try to change color axis
caxis([min(Table.Activity) max(Table.Activity)])
colormap jet

Más respuestas (0)

Categorías

Más información sobre View and Analyze Simulation Results en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by