Plotting data with large jumps in scale

Question about how to plot something. Say you have a data set, there's a bunch of data clustered between [1,3] then you have a huge jump and more data clustered at [68 70]. How do you plot so that the scale between 3 and 68 is small compared to the rest of the graph.
if true
% And here is my code.
figure
hold on
L1=line( t(i:dF(3,1)), cumulativeDevelopment(1,i:dF(3,1)));
L2=line( t(dF(3,1):dF(3,2)), cumulativeDevelopment(2,dF(3,1):dF(3,2)));
L3=line( t(dF(3,2):dF(3,3)), cumulativeDevelopment(3,dF(3,2):dF(3,3)));
L4=line( t(dF(3,3):dF(3,4)), cumulativeDevelopment(4,dF(3,3):dF(3,4)));
hold off
set(L1 , ...
'LineStyle' , '-' , ...
'Marker' , 'none' , ...
'Color' , [1 0 0] );
set(L2 , ...
'LineStyle' , '--' , ...
'Marker' , 'none' , ...
'Color' , [0.5 0 0.6] );
set(L3 , ...
'LineStyle' , '-.' , ...
'Marker' , 'none' , ...
'Color' , [0 0 1] );
set(L4 , ...
'LineStyle' , '-' , ...
'Marker' , 'none' , ...
'Color' , [0 1 0] );
end

回答 (1 件)

Image Analyst
Image Analyst 2013 年 2 月 24 日

0 投票

I don't have your data or the function cumulativeDevelopment() so I can't run your code. I'm not sure what you're doing with line(). Why not use semilogy() to plot?

2 件のコメント

Garrett Culos
Garrett Culos 2013 年 2 月 24 日
So I found a quick fix, not what i want though. If you look at the 'YTickLabel' near the end you can kinda see what im talking about. The semilog ill change the scale continuously, I want to change the scale so that a to b has scale y1, b to c has scale y2, and c to d has scale y1, where a,b,c,d are points on the y axis (1 3 68 70).
figure('Position',[700 10 600 400])
hold on
L1=line( t(i:dF(3,1)), cumulativeDevelopment(1,i:dF(3,1)));
L2=line( t(dF(3,1):dF(3,2)), cumulativeDevelopment(2,dF(3,1):dF(3,2)));
L3=line( t(dF(3,2):dF(3,3)), cumulativeDevelopment(3,dF(3,2):dF(3,3)));
L4=line( t(dF(3,3):dF(3,4)), cumulativeDevelopment(4,dF(3,3):dF(3,4))-65);
hold off
hLegend=legend('Stage 1','Stage 2','Stage 3','Stage 4');
htitle=title('GFunction Mapping Process');
hYLabel=ylabel('Cumulative Development');
hXLabel=xlabel('Time (Julian Day)');
set(L1 , ...
'LineStyle' , '-' , ...
'Marker' , 'none' , ...
'Color' , [1 0 0] );
set(L2 , ...
'LineStyle' , '--' , ...
'Marker' , 'none' , ...
'Color' , [0.5 0 0.6] );
set(L3 , ...
'LineStyle' , '-.' , ...
'Marker' , 'none' , ...
'Color' , [0 0 1] );
set(L4 , ...
'LineStyle' , '-' , ...
'Marker' , 'none' , ...
'Color' , [0 0.7 1] );
set(gca, ...
'Box' , 'on' , ...
'TickDir' , 'out' , ...
'TickLength' , [.02 .02] , ...
'XMinorTick' , 'on' , ...
'YMinorTick' , 'on' , ...
'YGrid' , 'on' , ...
'XGrid' , 'off' , ...
'YColor' , [0 0 0] , ...
'LineWidth' , 1 , ...
'Xlim' , [0 530] , ...
'Ylim' , [0 5] , ...
'YTick' , [0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5], ...
'YTickLabel' , {'0','1','1.5','2','2.5','3','3.5','JUMP','69','69.5','70'} );
set([gca,htitle, hXLabel, hYLabel,hLegend] , ...
'FontName','AvantGarde' ,...
'FontSize',12 );
<<C---Users--Garrett--Dropbox--Math-Projects--Mecinus-toadflax-Honors-Project--Latex.IntermReport>>
Image Analyst
Image Analyst 2013 年 2 月 24 日
I still can't run your code but it's good that you got something that works (I think) for you.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeGraphics Performance についてさらに検索

質問済み:

2013 年 2 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by