Yaxis becomes periodic after using ylim

7 visualizaciones (últimos 30 días)
Zeynab Mousavikhamene
Zeynab Mousavikhamene el 6 de Ag. de 2020
Editada: Walter Roberson el 6 de Ag. de 2020
Here is the y axis without using ylim:
and here is the yaxis after using ylim([50 100])
why it looks weird? how can I fix the issue?

Respuesta aceptada

Walter Roberson
Walter Roberson el 6 de Ag. de 2020
I predict that you have either used yyaxis or xxaxis, or else that you have use the older plotyy(), or else that you called axes() more than once with overlapping Position. In such cases, you would have multiple axes in the same location. However, your ylim() call is only affecting one of the axes, so it is getting out of synchronization for labels with the other.
This kind of problem was more likely to happen with plotyy() or calling axes() multiple times.. yyaxis() and xxaxis() are more careful to put the tick labels on opposite side of the graph.
  2 comentarios
Zeynab Mousavikhamene
Zeynab Mousavikhamene el 6 de Ag. de 2020
I was using hold on with scatter and it was overlapping. I added ylim manual and resolved. Thanks for the hint.
Walter Roberson
Walter Roberson el 6 de Ag. de 2020
Editada: Walter Roberson el 6 de Ag. de 2020
I do not think you can get that particular error unless you have overlapping axes, which you would not get with "hold on"

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Two y-axis 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