File Exchange

image thumbnail

Interactive Data Navigation Pane Widget

version (11.2 KB) by Olivier
Widget to interactively & graphically select a section of a large dataset you want to work on


Updated 12 Feb 2013

View Version History

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

This widget will give you access to one of the most common task you have to perform when you manipulate large data sets:
Selecting within this large data set what portion of data you want to work on.

This easy to use widget will enable you to:

- Interactively define the section of your data set you want to work on. To do so you just have to drag and drop cursors that define the limits of your section

- Automatically execute callbacks when you start dragging one of the cursors, while you are dragging the cursor and when you release the cursor

See the demo_uiHistory.m file for a preview of how to use this widget.

Cite As

Olivier (2021). Interactive Data Navigation Pane Widget (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (16)

Mark Jackson

Great bit of code. I updated it to allow linear or log scale selection on both the axes but the "fill" colour doesn't work for log scales (a log scale rendering issue)



very useful tool

Eric Cheng


Great submission.

I second the ideas of Yair, especially, that you should make the selected area "dragable"! That would really round it off! Thx!


Calvin Hsieh

Great submission.

However, I keep getting a "Input argument "cursorPosition" is undefined error. Can you comment?


sounds useful but I couldnt use it.
please consider the fact that not everyone here is advanced in MATLAB. How should we pass the inputs to this widget inside our code?
what is 'parent'? how should the 'data' be defined?

Robert Barrie

If you are doing time series data manipulation, you might also like Thomas' other example 'Graphical Points Selection'. Great work. Thanks heaps!

Robert Barrie

Robert Barrie


For those who do not have 7.6 or later (uiHistory). same feature can be readily developed by using :

Yair Altman

Very nice execution!

I was planning on doing something similar based on Google Finance's example, but with your submission there's really no need. An altogether excellent submission and a fine example of Matlab OOP.

A few suggestions:
1) uiHistory works on R2008a (Matlab 7.6) onward. You might consider some coding changes for it to work on R2007b and earlier: 'private' instead of private (and so on for other modifiers); not inheriting hgsetget etc.
2) You might consider modifying the cursor over the handle bars to right-left arrows (see my ScrollPlot submission for example)
3) You might consider setting the central patch (between the handle bars) draggable, so that the user can interactively pan the zoomed contents (again, see ScrollPlot for example)
4) You might consider enabling the two edit-boxes, so that users can enter specific dates.
5) You might consider adding a shading between the zoom patch below and the displayed graph above, just like in your screenshot. For some reason I don't see this on my R2008a/b.
6) You might consider adding to the main graph axes annual grid-lines (like in the zoom axes below) and tick labels (so that we know what event happened when)
7) Finally, I would suggest displaying the figure toolbar, or at least enable data-cursor mode (whose callback should be modified to display a human-readable date).

Jonathan Lister

First class coding! Nice work. I love the new classdef.

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!