Change position of numbers on x axes in surface plot

2 visualizaciones (últimos 30 días)
Fredrik
Fredrik el 23 de Mzo. de 2012
Hi. I plot a surface plot and the numbers in the xaxis match the lines that go through the surface. Is there any way to get the numbers to be inline with the middle of the squares instead of inline with the lines in the surface plot?
So I would like to move all numbers on x-axis with say half a step, the same for y-axis.
Is this possible to do?
Greateful for all help!
Kind Regards, Fredrik

Respuesta aceptada

Kevin Holst
Kevin Holst el 23 de Mzo. de 2012
Perhaps something like this would work for you?
grid off %this prevents the addition of gridlines at half spacing
ha = gca
set(ha,'XTick',1.5:1:9.5)
set(ha,'XTickLabel',1:9)
set(ha,'YTick',1.5:1:9.5)
set(ha,'YTickLabel',1:9)
Does that do what you're wanting?

Más respuestas (1)

Fredrik
Fredrik el 27 de Mzo. de 2012
I have also made this plot with imagesc and not only surface.
When I try the same approach here, it does not work. The grid follows the numbers no matter what.
Any suggestion on how to solve this?
Kind Regards, Fredrik

Categorías

Más información sobre Surface and Mesh Plots 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