File Exchange

image thumbnail

GINPUT funtion to be used in GUIs

version 1.0 (12.5 KB) by

This function works similar to GINPUT but only presents the crosshair in axes specified by the user.



View License

This function works similar to GINPUT. However it allows the user to specify which axes or multiple axes are active, being the crosshair only shown within these axes. It also returns which axes did the user click on.

Comments and Ratings (11)

doesnt work :(

really useful, exactly the same comportment as GINPUT but without the big cross hair which is really nice and you can specify the axe which is great


DGM (view profile)

It looks like there's a lot of work in what should be a very useful tool.

I never could get it to work consistently across Matlab versions without modification. I had problems in anything but simple single-axes figures. I ended up having to specify the figure as the parent of the specified axes, otherwise it would either spawn a new figure or dump error messages.

In the end, the fact that this relies on waitforbuttonpress() means it makes combined mouse/kb input problematic in my application. The code was tremendously helpful in developing my own approach to event handling though.

how can I wacth this video ?


Dan (view profile)


Dan (view profile)

This is a great tool, thanks for submission! The only problem that i had is, that i have a more complex GUI layout, where the axes in question are not the direct child of the figure, hence the script assumes the axes in the wrong place. I added this functionality for me so that it also works in such cases.I can share the additional lines of code if you like

The video doesn't work and I can't get ginputax to work either.

And I can't get ginputax to work either.

Geoff Hayes

This is a neat submission (and works well) but just note that the examples (in the file header) are opposite to how they should be invoked. The axes handle(s) should be the first input to the function, and the number of points should be the second input. If there is more than one handle, then this should be passed as an vector rather than as a cell array. Note that the fourth output, the axes that each point belongs to, only gets set with the last point's axes (so if four points are selected, then we only see the axes for the fourth point).

MATLAB Release
MATLAB 7.13 (R2011b)
Tags Add Tags

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today