Borrar filtros
Borrar filtros

How to plot 2 x-axis with pcolor and colormap

2 visualizaciones (últimos 30 días)
Shan  Chu
Shan Chu el 15 de Jun. de 2016
Comentada: Chad Greene el 16 de Jun. de 2016
Dear all, I have troubles with plotting 2 x-axis with colormap. It seems like the first axis size will change with the function colormap. Also, the value of the colormap isn't right
X = rand(100,100);
x = linspace(1,100,100);
x2 = linspace(0.1,60,100);
y = linspace(100,200,100);
figure
ax1 = axes();
pcolor(ax1, x,y,X);
shading flat
h = colorbar;
ax2 = axes( 'Position', get(ax1, 'Position'), 'XAxisLocation', 'top', 'Xlim', [x2(1), x2(end)], 'YLim', get(ax1, 'YLim'), 'YTickLabel', []);
uistack(ax2, 'bottom')
shading flat
h = colorbar
ylabel(h, '| \kappa |')
colormap jet
Could you please help? Thanks
  1 comentario
Chad Greene
Chad Greene el 16 de Jun. de 2016
The second set of axes has no data associated with it, so the caxis values won't be right. What exactly are you trying to plot on the second set of axes?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by