Filter löschen
Filter löschen

Fast and easy axis break

4 Ansichten (letzte 30 Tage)
A T
A T am 25 Jun. 2014
Kommentiert: dpb am 25 Jun. 2014
My problem is that I have 540 data points out of which I take data for graphing by groups of 30 (so 18 graphs) for one dataset. Sometimes I need axis breaks - sometimes on the x axis, sometimes on the y-axis, sometimes both; the position of the breaks also varies. I know there are file exchange contributions, but all of them take a lot of time, to write for each graph. I have also tried with the subplot command - but it gives me an error:()-indexing must appear last in an index expression. Which I think occurs because I call my data in groups.
So my script looked something like this:
subplot(2,1,1);plot(x(31:60)(y(31:60)>=160),y(31:60)(y(31:60)>=160),'.');
set(gca,'XTickLabel',[]);
subplot(2,1,2);plot(x(31:60)(y(31:60)<=20),y(31:60)(y(31:60)<=20),'.');
How can I work around this problem.
  1 Kommentar
dpb
dpb am 25 Jun. 2014
I worked out a solution for the indexing issues, not sure what, precisely, you mean/want on the "axis break" part???

Melden Sie sich an, um zu kommentieren.

Antworten (1)

dpb
dpb am 25 Jun. 2014
plot(x(31:60)(y(31:60)>=160),y(31:60)(y(31:60)>=160),'.');
becomes
i1=31; i2=60; % the ranges for the case
yLim=160; % and the test value
x1=x(i1:i2); y1=y(i1:i2); % make a temporary for the range
ix=(y1>=yLim); % the logical array inside the temporary
plot(x1(ix),y1(ix),'.');
Now you can simply update i1, i2 and yLim for each case...

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by