How to dynamically update figure ticks and labels while inspecting data

I am often plotting data, then I want to zoom in/out to get a better understanding of smaller details within a bigger set of data. When I zoom in using the magnifying glass feature, it would be great if the axes updated. For example, if the x-axis goes from 0-10 in units of 1 increments, then I zoom into the section between x=1.1 and x=1.9, there is no information on the x-axis to indicate where I am anymore. Is there an easy way to deal with this?

 採用された回答

Daniel
Daniel 2014 年 8 月 29 日
編集済み: Daniel 2014 年 8 月 29 日

0 投票

I think I have answered my own question. This tool works really well for zooming while using datetick. I just put the .m file in the MATLAB search path, and everything worked flawlessly (after restarting MATLAB).

その他の回答 (2 件)

Michael Haderlein
Michael Haderlein 2014 年 8 月 29 日
Actually, it does update the ticks by default. You might have set the XTickMode to Manual, either directly or by setting the XTick property. So, if you enter
set(axes_handle,'XTickMode','auto')
you will bring this functionality back.
Daniel
Daniel 2014 年 8 月 29 日
Indeed, you are right, Michael. I forgot to mention that most of my data is time series data, and I like to use the datetick so that I am looking at actual dates/times instead of just a days since year 0. I do this so often that I forgot that MATLAB does dynamically update for regular numbers. However, in my case, I might make a plot using:
plot(time,temperature);
xlabel('time (dd-mm-yy HH:MM)');ylabel('temperature (°C)')
datetick('x', 'dd-mm-yy HH:MM')
Do you know how I can dynamically update the x-axis in this case?

カテゴリ

製品

質問済み:

2014 年 8 月 29 日

編集済み:

2014 年 8 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by