make colorbar range consistent across various plots

20 visualizaciones (últimos 30 días)
Nicole Schrier
Nicole Schrier el 8 de Nov. de 2019
Comentada: Nicole Schrier el 8 de Nov. de 2019
I am trying to plot images that have the option to go up to a value of 700 (hence max set to 700 on colorbar) but if value is only to 300 my colorbar looks like this and I am not able to compare to images with the 700 max. If graph goes to 700 colorbar looks normal. How can I resolve this?
currently using:
caxis([0 700])
colormap(jet)
scatter(data.x(:,1),data.y(:,1),25,data.s(:,1),'filled')
colorbar('Limits',[0 700])

Respuestas (1)

Walter Roberson
Walter Roberson el 8 de Nov. de 2019
Call caxis() after you plot your data. When you do not have hold on in effect, the scatter() call (and most other high-level graphics calls) clear the axes properties including the color axis limits.

Categorías

Más información sobre Color and Styling 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