Fast and easy axis break

5 vues (au cours des 30 derniers jours)
A T
A T le 25 Juin 2014
Commenté : dpb le 25 Juin 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 commentaire
dpb
dpb le 25 Juin 2014
I worked out a solution for the indexing issues, not sure what, precisely, you mean/want on the "axis break" part???

Connectez-vous pour commenter.

Réponses (1)

dpb
dpb le 25 Juin 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...

Catégories

En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by