I'm trying to plot a 10 million point data and the x-axis covers a range of 1 (i.e. 0 to 1). As I zoom in to view data, the x-axis label doesn't provide me with enough resolution. It's stuck at 4 decimal points while I need 7. I know one common solution is to set the gca xticklabel using a sprintf generated axis data. I've tried that but that only works when no zooming is involved. The axis values are stuck at the original no matter how much I zoom in.
So my question is how do I increase the decimal point of the axis label without resorting to using sprintf?
Would appreciate any help!

댓글 수: 2

Stephen23
Stephen23 2016년 7월 8일
@Benjamin Yap: what MATLAB version are you using ?
Benjamin Yap
Benjamin Yap 2016년 7월 11일
@Stephen Cobeldick: I was using R2013. I looked at the zoom callback function Steven Lord recommended for versions prior to R2015b and thought that's too complicated. The 'TickLabelsFormat' implementation is so much more convenient. So I upgraded mine to R2016a. I've been considering to upgrade anyway.

댓글을 달려면 로그인하십시오.

 채택된 답변

Steven Lord
Steven Lord 2016년 7월 8일

2 개 추천

If you're using release R2015b or later, set the ruler's TickLabelFormat property, described in the Tick Values and Labels section of the numeric ruler properties documentation page.
In earlier releases, call zoom with an output and set that output's ActionPostCallback property to a function that updates the tick labels. See example 5 on the documentation page for zoom for an example you can adapt.

댓글 수: 2

Benjamin Yap
Benjamin Yap 2016년 7월 11일
Hi Steven! Thank you very much! I upgraded to R2016a to use the 'TickLabelsFormat' function. It's absolutely convenient. I didn't try the zoom call back function but looks like it requires much more work.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Exploration에 대해 자세히 알아보기

질문:

2016년 7월 8일

댓글:

2019년 11월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by