Diff limits on same axis

1 Ansicht (letzte 30 Tage)
Somnath Kale
Somnath Kale am 24 Dez. 2020
Bearbeitet: Cris LaPierre am 24 Dez. 2020
Hi
I want to set two limits on my same axis i have attached the fig below, on xaxis i want limits from -50 to 225 and again from 775 to 850.
My current limits are
xlim([-50 850])
ylim([-19 140])
One can please sugget a better replacement for the one.Thanks in Advance!!
  1 Kommentar
dpb
dpb am 24 Dez. 2020
Then the x axis physical location for the last point is totally arbitrary...just change its x value to (say) 400 and the label the xtick to 800 for that location.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Cris LaPierre
Cris LaPierre am 24 Dez. 2020
Bearbeitet: Cris LaPierre am 24 Dez. 2020
MATLAB does not provide a function for this. However, this post contains some suggestions.
Another option is to realize that your xtick values and xticklabels do not have to be the same. You could plot against one set of xvalues, then create tick labels that display the values you want.
x = [1 3 6 55];
y = [100 85 77 44];
err = 8*ones(size(y));
errorbar(y,err,'o')
xticks(1:4)
xlim([0 5])
xticklabels(x)
  1 Kommentar
Somnath Kale
Somnath Kale am 24 Dez. 2020
Thanks Cris! its useful
Happy christmas!!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Christmas / Winter finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by