My initial patch is ready for your review.

I tested with latest svn and customized key-mapping (from matplotlibrc) is
working correctly.

Please review, and let me know if there would be any better solution,
variable naming, placing etc.. I can also update the
http://matplotlib.sourceforge.net/users/navigation_toolbar.html accordingly.

On Mon, Jan 25, 2010 at 12:58 PM, Gökhan Sever <gokhanse...@gmail.com>wrote:

> Hello,
>
> I could these keys into rcsetup.py file as well as matplotlibrc.template
> and update backend_bases.py accordingly. And add some documentation
> reflecting
> the changes made.
>
> # Event keys to interact with figures/plots via keyboard
>
> fullscreen : 'f'
> home : 'h'
> reset : 'r'
> back : 'c'
> forward : 'v'
> pan : 'p'
> zoom : 'o'
> save : 's'
> grid : 'g'
> yscale : 'l'
> xscale : 'k'
>
>
> *Notes:*
>
> Matthias, leaving values as empty will remove the key short-cut.
>
> Don't understand exactly what 'a' does?
>
> f doesn't toggle full-screen --using qt4agg backend.
>
> There are a couple function duplicates. (eg. back with 'c' and left and
> backspace keys. How can represent them? Create a list inside the
> dictionary?
> back = ['c', 'left', 'backspace']
>
> 'o' seems like unnecessary. Since you have to select an area using mouse.
>
> 's' doesn't behave correctly here. Shouldn't it bring the save dialog?
> Instead I am getting:
> TypeError: save_figure() takes exactly 1 argument (2 given)
>
>
>
> On Mon, Jan 25, 2010 at 8:32 AM, Matthias Michler <matthiasmich...@gmx.net
> > wrote:
>
>> Hi Gökhan,
>>
>> I just wanted to discuss the key, because I think this patch should be
>> part of
>> matplotlib and not only of individual users. I think it is worth be be
>> added
>> to the mpl-tracker at http://sourceforge.net/tracker/?group_id=80706 or
>> maybe
>> one of the developers has the time to commit this small change?
>>
>> I think your idea about key-mappings in the matplotlib-rc is a good option
>> to
>> customize keyboard short cuts and even remove short-cuts which aren't of
>> intrest for the individual user. Furthermore the latter yields space for
>> keyboard shortcuts, which are used in one's own program.
>>
>> Kind regards,
>> Matthias
>>
>> On Friday 22 January 2010 16:57:22 Gökhan Sever wrote:
>> > It is very simple to change key-assignment. Take a look at the
>> > backend_bases.py code (search for event.key instances) :
>> >
>> >         elif event.key == 'L':
>> >
>> > I was thinking to move y-scaling to "y" and x-scaling to "x" but x and y
>> > are assigned to something else (
>> > http://matplotlib.sourceforge.net/users/navigation_toolbar.html)
>> >
>> > For me toggling "k" is simpler for me than doing Shift-L.
>> >
>> > Maybe these options could be provided in the matplotlibrc file. Users
>> can
>> > make their key mapping based on their choice. That requires some more
>> > coding
>> >
>> > :)
>> >
>> > On Fri, Jan 22, 2010 at 1:59 AM, Matthias Michler
>> >
>> > <matthiasmich...@gmx.net>wrote:
>> > > Hi Gökhan, Hi list members,
>> > >
>> > > This is really a missing feature in matplotlib in my opinion and it's
>> > > great that you took the time to make an suggestion, but I would prefer
>> > > capital "L"
>> > > for the xaxis-scaling like gnuplot although I'm not sure this is
>> > > possible.
>> > >
>> > > What do you and other list members think about that?
>> > >
>> > > Kind regards,
>> > > Matthias
>> > >
>> > > On Thursday 21 January 2010 19:45:37 Gökhan Sever wrote:
>> > > > Hello,
>> > > >
>> > > > "l" key does the log - linear scaling for y-axis. I have made a
>> minor
>> > > > change to use "k" for x-axis scaling.
>> > > >
>> > > > Patch added. Feel free to add if you find it useful.
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Throughout its 18-year history, RSA Conference consistently attracts the
>> world's best and brightest in the field, creating opportunities for
>> Conference
>> attendees to learn about information security's most important issues
>> through
>> interactions with peers, luminaries and emerging and established
>> companies.
>> http://p.sf.net/sfu/rsaconf-dev2dev
>> _______________________________________________
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>
>
> --
> Gökhan
>



-- 
Gökhan

Attachment: keymap.patch
Description: Binary data

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to