View License

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

» Watch video

Highlights from
ginput2.m v3.1 (Nov 2009)

4.2 | 9 ratings Rate this file 35 Downloads (last 30 days) File Size: 7.49 KB File ID: #20645 Version: 1.4
image thumbnail

ginput2.m v3.1 (Nov 2009)



09 Jul 2008 (Updated )

Same as GINPUT but with ZOOM, PAN and (optionally) PLOT and image SCALE/GEOREFERENCE!

| Watch this File

File Information

Do you still use GINPUT to graphically select points on current axes with the mouse? Try this one!

With GINPUT2 you can also:
1. ZOOM: in, out (double-click)!
2. PAN: when dragging!
3. DELETE: last selected point!
4. PLOT: while selecting! (optional, just input the line style!)
5. SCALE or GEOREFERENCE images! (optional, just input: true)

So, besides of selecting points in a more precise way (zooming) you can DIGITIZE(!!!) lines with the last two options, by simply using:
>> ginput2(true,'.k')

Enjoy it!
Bug reports and comments will be very appreciated!


Zinput, Graphical Data Selection Tool, and Digitize07 inspired this file.

This file inspired Image Digitizer, Click2smooth.M V1.0 (Sep 2009), T Marigram.M V1.3, Gdistm, Gdist, and Clickz.

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (11)
22 Dec 2016 Zoidberg

30 Aug 2016 GagoX

GagoX (view profile)

To deactivate the rezoom, just comment line 613

% Centers the selected point if ZOOM-IN: 29 SEP,2008
if all((lim~=zlim))
lim = [x+diff(lim(1:2))/2*[-1 1] y+diff(lim(3:4))/2*[-1 1]];
axis(lim) %Comment this line to deactivate recentering after each point selection

15 Aug 2014 adi

adi (view profile)

needs one big improvement: when I zoom in, the image jumps every time I select a point! this is very annoying... otherwise, a very good tool

11 Aug 2014 Genevieve

01 Oct 2012 Andrew Simpson

This looks very promising, but isn't working for me - I've tried various ways of running it, including the examples in the source, and every time I click on the plot it simply zooms in. I'm sure this isn't the expected behaviour - I can't get it to select any points at all, just zoom.

I'm using R2012a.

10 Feb 2011 Sherif

Sherif (view profile)

Excellent work. Thank you very much.

20 Oct 2010 Igor

Igor (view profile)

26 Feb 2010 Mehdi

Mehdi (view profile)

Thanks for sharing such a useful code,
for my data, after running my code I get images for which I need the following action:
When selecting a part of image,I want Matlab to run my code for that area and calculate or graph other parameters for that part of image,
How can I do that?

Comment only
01 Dec 2009 Anilson

I take that back. It does work on 3 dimension picture.
I apologize.

Comment only
01 Dec 2009 Anilson

06 Mar 2009 Olga Avila

This is really good!
It works perfect for me, and was exactly what I needed...
I just added a minor detail to plot a line from an input center point to the ginput point selected by the user (like a radial line). This was just to improve visualization for my needs.
Thank you very much!

08 Jun 2009 1.1

Changed default YESERROR value and fixed a bug there. Changed behavior when N==1. Fixed bug with zoom out. Changed default selection keys. Changed default selection click mouse: from left one to the right one.

20 Aug 2009 1.2

v2.1 Fixed bugs related with points delection. Added new 'keepzoom' feature.

05 Nov 2009 1.3

v3.0 Now allows panning while dragging. Some changes on help.

12 Nov 2009 1.4

v3.1 Now returns when N=1 and an "strange" KEY is pressed.

Contact us