How to make a break on the x axis?

40 visualizaciones (últimos 30 días)
hello
hello el 24 de Ag. de 2017
Comentada: Lea el 4 de Mayo de 2024
Suppose I have a plot and I want to start at 0 on the x axis(every 10 units) but I also want a break so that after zero my next point is 100 instead of 20. My numbers on x axis should look like 0, break, 100,110,120 etc. I know there is also some symbol to represent the break on the axis.
  2 comentarios
Brando Miranda
Brando Miranda el 11 de Jul. de 2018
did u find what u were looking for?
Lea
Lea el 4 de Mayo de 2024

Iniciar sesión para comentar.

Respuestas (3)

KL
KL el 24 de Ag. de 2017
plot(rand(150,1))
xticks([0 100 120 150])
  4 comentarios
hello
hello el 24 de Ag. de 2017
Actually I am trying to break the xaxis on the histogram.
KL
KL el 24 de Ag. de 2017
It would be efficient if you could explain your question clearly instead of your short responses. Also it's easier to help if you provide us some sample data and code that you're working with. Have you checked out the link Jan gave on his answer?

Iniciar sesión para comentar.


Jan
Jan el 24 de Ag. de 2017
Take a look into the file exchange:
Even a search in the internet for "Matlab axis break" will be useful. I like the power of this forum, but asking an internet search engine is usually much faster than waiting for a person to post a solution.
  1 comentario
Maulik Shah
Maulik Shah el 11 de Mayo de 2018
Hi Jan, Is there any way to break x-axis in loglog plot? Thanks,

Iniciar sesión para comentar.


Serge Mooyman
Serge Mooyman el 14 de Ag. de 2018
Editada: Serge Mooyman el 14 de Ag. de 2018
Hey, well, okay, I got the function breakxaxis running, and have a beautiful break just where I want, but.... I need several in the same graph. I tried "hold on" and then a new command, in this case:
i = breakxaxis([100 120]);
However, this gives an error:
Error using breakxaxis (line 75) splitXLim must be in the range given by get(AX,'XLim')
Bottom line: does anyone know a way to include more than one braek in your X axis?
I would love to know
Serge
  2 comentarios
Ehsan Amin
Ehsan Amin el 20 de Abr. de 2020
Hi there, I used subplot and repositioned them to have desired figure. You can invisible ticks to have axis line in break region. by this way you can have several breaks in both x and y axis.
franco otaola
franco otaola el 23 de Jul. de 2020
hello ehsan,
would it be possible to show the script how you have done it?
best regards

Iniciar sesión para comentar.

Categorías

Más información sobre Graphics Object Properties 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