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.
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
I second the ideas of Yair, especially, that you should make the selected area "dragable"! That would really round it off! Thx!
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?
If you are doing time series data manipulation, you might also like Thomas' other example 'Graphical Points Selection'. Great work. Thanks heaps!
For those who do not have 7.6 or later (uiHistory). same feature can be readily developed by using :
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).
First class coding! Nice work. I love the new classdef.
Updated cursor object
Create scripts with code, output, and formatted text in a single executable document.