[Tutor] How to zoom in matplotlib without a mouse ?

Dave Angel davea at davea.name
Mon Apr 29 13:20:16 CEST 2013


On 04/29/2013 05:07 AM, eryksun wrote:
> On Fri, Apr 26, 2013 at 4:50 PM, Peter Rowat <peter at pelican.ucsd.edu> wrote:
>> To "zoom" a matplotlib graph, the matplotlib docs all say "use R mouse button".
>>
>> But my laptop has no mouse, only a touchpad (running OSX Mountain Lion).
>> I've tried lots of  "click plus key" combinations, no luck yet.
>>
>> Any ideas?
>
> I'm not a Mac user. A right-mouse click is often called a "secondary"
> click, which is possibly a "two finger" click on your Mac.
>
> With the "pan/zoom" tool, you zoom the axes by moving the pointer
> while holding the secondary button. I don't know how easy that will be
> with your touchpad. I usually use the "zoom rect" tool; you drag a
> rectangular outline over the area you want to zoom. You could also use
> ion() to switch to interactive mode. Then use axis([xmin, xmax, ymin,
> ymax]) to programmatically zoom the graph.
>

I'm not a Mac user either.  But doing a quick DuckDuckGo search using 
the keywords:
     osx right mouse click

I find that ctrl-click is supposed to emulate a right-click.  Seems to 
me that ought to work with the touchpad as well as with the mouse.

Alternatively, the following quote:

     http://www.macinstruct.com/node/66
If you own a Macbook or Macbook Pro, you can configure your trackpad for 
right-clicking. (Some older iBooks and Powerbooks also provide this 
feature.) Simply open the Trackpad options in System Preferences and 
make sure the Place two fingers on trackpad and click button for 
secondary click button is checked.

or

     http://osxdaily.com/2011/05/24/enable-right-click-mac/
Open System Preferences
Click on Trackpad
Under the ‘One Finger’ section, select the checkbox next to “Secondary 
Click” and select “Bottom Right Corner”
Adjust the standard Mac OS X secondary click behavior with a two 
fingered click as you see fit
I would suggest keeping things foolproof and having both options enabled.




-- 
DaveA


More information about the Tutor mailing list