how to break and rezero x-axis

I would like to make a plot with two different, consecutive x-axis in the same plot with a break symbol -//- between the break and where the x-axis starts from 0 again after the break. My data looks something like that below but in reality, both x and y vectors contain 10-15 000 entries. Anyone got any suggestions?
y=[0 0.1 0.3 0.6 0.4 0.4 0.38 0.32 0.2 0]
x=[50 100 150 200 250 -//- 0 5 10 15 20]

Antworten (1)

ANKUR KUMAR
ANKUR KUMAR am 9 Jan. 2018

2 Stimmen

You can break your x axis by using this function from file exchange
Second job is to rezero the breaked x axis. You can set xticks and xtickslabel to rezero the axis.

2 Kommentare

Endre Fenes
Endre Fenes am 9 Jan. 2018
Thank you for your suggestion, but I think I choose my words poorly in my question. In reality, my x and y vectors contain 10-15 000 values. To my understanding, i would have to write each value manually if I were to use xtics. If this is correct then xtics is not a viable option?
ANKUR KUMAR
ANKUR KUMAR am 9 Jan. 2018
You can use xticks([0:1000:15000])
It will put ticks on these values.
For labels, just use xticklabels([0:1000:15000])

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Graphics Performance finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 9 Jan. 2018

Kommentiert:

am 9 Jan. 2018

Community Treasure Hunt

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

Start Hunting!

Translated by