I want to rescale a contourf plot when I zoom in and out

조회 수: 6 (최근 30일)
jlt199
jlt199 2016년 6월 1일
Ok, I will do my best to describe this. I have a matrix that I've plotted using a contour plot. The matrix is very feature rich, lots of peaks and troughs. However, The first and last few rows of the matrix are excessively large. Therefore most of the feature in the middle become hidden because the contours are so big to compensate.
I would like to attach some code to the zoom feature of the figure to rescale the contours after I have zoomed in/out on the figure, to only scale for what is currently being shown. This is how far I have got:
figure;
contourf(thisSec')
g = colorbar;
h = zoom;
h.ActionPostCallback = 'rescale(thisSec)';
Where my rescale function is currently:
function [] = rescale(myData)
Xlimits = round(get(gca,'XLim'));
Ylimits = round(get(gca,'YLim'));
thisData = myData(Xlimits(1):Xlimits(2),Ylimits(1):Ylimits(2));
maxData = max(max(thisData));
minData = min(min(thisData));
caxis([minData maxData]);
This does something to the colormap, but not exactly what I'm after. It doesn't show anymore features as I zoom in, but it does recolor things.
Can anyone help me with this please?
Thanks

답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by