Show the xticks in the view of 2D

Hi, I use surf to plot a 3D surface, see below
And I want to see it in 2D view, so I use view(2), and I get the figure below.
But for this 2D contour, xticks disappear (only 5, 10, ... show but no tick marks).
I guess it is due to some settings in 3D surface. Could anyone help me to solve this problem to make it like a general 2D figure? Thanks!

 Respuesta aceptada

Star Strider
Star Strider el 6 de Oct. de 2021

0 votos

The default tick direction is 'in', so the x-ticks are not visible in the second plot.
Set TickDir to 'out' or 'both' to see them.
.

4 comentarios

Ying Wu
Ying Wu el 6 de Oct. de 2021
Thanks! I solved this problem by applying your solution! The xticks are shown but the x-axis seems to be covered by the contour, do you know how to make the x-axis visible? Thanks!
My pleasure!
Without the actual data to experiment with, I can only suggest a solution.
Perhaps:
ylim([min(ylim)-0.2 max(ylim)])
would make them visible.
It may be necessary to experiment with that sort of approach to get the desired result.
.
Ying Wu
Ying Wu el 6 de Oct. de 2021
That works! Thanks you soooo much!~
Star Strider
Star Strider el 6 de Oct. de 2021
As always, my pleasure!
.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.

Productos

Versión

R2020b

Preguntada:

el 6 de Oct. de 2021

Comentada:

el 6 de Oct. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by