Assigning "k" key for xscaling

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.

xscale.patch (813 Bytes)

···


Gökhan

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.

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 :slight_smile:

···

On Fri, Jan 22, 2010 at 1:59 AM, Matthias Michler <MatthiasMichler@…361…> 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

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 matplotlib download | SourceForge.net 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

:slight_smile:

On Fri, Jan 22, 2010 at 1:59 AM, Matthias Michler > > <MatthiasMichler@...361...>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.

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 <MatthiasMichler@…361…> 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

:slight_smile:

On Fri, Jan 22, 2010 at 1:59 AM, Matthias Michler > > > > > > <MatthiasMichler@…2559…1…>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

Constrain pan/zoom to x axis
hold x
Constrain pan/zoom to y axis
hold y
I don’t have these in my backend_bases.py file. Are these working on your system?

···

On Mon, Jan 25, 2010 at 12:58 PM, Gökhan Sever <gokhansever@…287…> 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 <MatthiasMichler@…361…> 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

:slight_smile:

On Fri, Jan 22, 2010 at 1:59 AM, Matthias Michler > > > > > > > > > > <MatthiasMichler@…361…>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

Hi Gökhan,

Constrain pan/zoom to x axis hold *x* Constrain pan/zoom to y axis hold *y*
I don't have these in my backend_bases.py file. Are these working on your
system?

Yes they do, but only for "pan/zoom"-mode and not for "rect zoom".

Kind regards,
Matthias

···

On Monday 25 January 2010 20:04:14 Gökhan Sever wrote:

On Mon, Jan 25, 2010 at 12:58 PM, Gökhan Sever <gokhansever@...1896....>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 > > <MatthiasMichler@...361... > > > > > 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 matplotlib download | SourceForge.net 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
>> >
>> > :slight_smile:
>> >
>> > On Fri, Jan 22, 2010 at 1:59 AM, Matthias Michler > >> > > >> > <MatthiasMichler@...361...>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
>> matplotlib-users List Signup and Options
>
> --
> Gökhan

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.

keymap.patch (5.45 KB)

···

On Mon, Jan 25, 2010 at 12:58 PM, Gökhan Sever <gokhansever@…287…> 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 <MatthiasMichler@…361…> 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

:slight_smile:

On Fri, Jan 22, 2010 at 1:59 AM, Matthias Michler > > > > > > > > > > <MatthiasMichler@…361…>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

Hi Gökhan,

I'm sorry I didn't had the time to look into your patch in the last days.

Today I did have a look at it and in my opinion you did a great job - Thanks!
The point is that I'm not a developer and therefore cannot commit it right
away :wink: .

Although it is great stuff I tried to even improve it. Attached you find my
svn-diff of the backend_bases.py, where I tried to get rid of the different
handling of *3* keys for home and *1* for save etc. I converted all key-maps
into lists and therefore the number of keys doesn't matter. With that I can
do also
xscale : L, k
in my matplotlibrc and allow for both of our favorite keys for the toggling of
the xscale :wink:

Concerning the names of the variables you find some changes in the attached
patch, which are not yet complete in my opinion, but I didn't want to spoil
your lines to much. If I have to decide between short and meaningful variable
names, I prefer meaningful at least if they don't blow up to 80 chars :wink: ...

In my opinion your next patch should be a part of matplotlibs svn, but as I
mentioned above I'm just a user. In case I can help you somehow in bringing
up this patch, don't hesitate to write again and hopefully I have the time to
help.

Kind regards,
Matthias

backend_bases.patch (3.78 KB)

···

On Friday 29 January 2010 20:22:20 Gökhan Sever wrote:

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 <gokhansever@...1896....>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 > > <MatthiasMichler@...361... > > > > > 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 matplotlib download | SourceForge.net 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
>> >
>> > :slight_smile:
>> >
>> > On Fri, Jan 22, 2010 at 1:59 AM, Matthias Michler > >> > > >> > <MatthiasMichler@...361...>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.

Hi list, Hi Gökhan,

I once more would like to say that I like the 2 new features introduced by
Gökhan (key 'k' for xscaling and the generalized handling of the key-mapping,
which allows the user to choose its prefered key for a certain task) and I'd
like to see this in matplotlib.

I attached a patch (against todays svn) of my final version, which is a
slightly modified version of Gökhans patch.

If anybody could test it and comments on this I'd be happy. Otherwise I will
place the patch on the patch tracker in (let's say) a week.

Thanks in advance for any help in order to bring this into matplotlib.

Kind regards,
Matthias

Hi Gökhan,

I'm sorry I didn't had the time to look into your patch in the last days.

Today I did have a look at it and in my opinion you did a great job -
Thanks! The point is that I'm not a developer and therefore cannot commit
it right away :wink: .

Although it is great stuff I tried to even improve it. Attached you find my
svn-diff of the backend_bases.py, where I tried to get rid of the different
handling of *3* keys for home and *1* for save etc. I converted all
key-maps into lists and therefore the number of keys doesn't matter. With
that I can do also
xscale : L, k
in my matplotlibrc and allow foGökhanr both of our favorite keys for the

toggling

keymap_revisted.patch (7.52 KB)

···

On Tuesday 02 February 2010 14:05:52 Matthias Michler wrote:

of the xscale :wink:

Concerning the names of the variables you find some changes in the attached
patch, which are not yet complete in my opinion, but I didn't want to spoil
your lines to much. If I have to decide between short and meaningful
variable names, I prefer meaningful at least if they don't blow up to 80
chars :wink: ...

In my opinion your next patch should be a part of matplotlibs svn, but as I
mentioned above I'm just a user. In case I can help you somehow in bringing
up this patch, don't hesitate to write again and hopefully I have the time
to help.

Kind regards,
Matthias

On Friday 29 January 2010 20:22:20 Gökhan Sever wrote:
> 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 <gokhansever@...287...>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 > > > <MatthiasMichler@...361... > > > > > > > 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 matplotlib download | SourceForge.net
> >> 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
> >> >
> >> > :slight_smile:
> >> >
> >> > On Fri, Jan 22, 2010 at 1:59 AM, Matthias Michler > > >> > > > >> > <MatthiasMichler@...361...>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.

Hi -- these look like useful changes. In most of matplotlib rc we
have a namespace for the rc keys, so I prefer something like

  keymap.fullscreen : f # toggling
  keymap.home : h, r, home # home or reset mnemonic

Also, could you include in your patch a diff against

  mpl/doc/users/navigation_toolbar.rst

documenting the changes.

Also, I'm not sure you need

+ # to get a common standard we move all keys for each action into a list
+ for key in [fullscreen_keys, home_keys, back_keys, forward_keys,
+ pan_keys, zoom_keys, save_keys, grid_keys,
+ toggle_xscale_keys, toggle_yscale_keys, all]:
+ if type(key) is not list:
+ key = list(key)

···

On Wed, Feb 17, 2010 at 8:08 AM, Matthias Michler <MatthiasMichler@...361...> wrote:

Hi list, Hi Gökhan,

I once more would like to say that I like the 2 new features introduced by
Gökhan (key 'k' for xscaling and the generalized handling of the key-mapping,
which allows the user to choose its prefered key for a certain task) and I'd
like to see this in matplotlib.

I attached a patch (against todays svn) of my final version, which is a
slightly modified version of Gökhans patch.

If anybody could test it and comments on this I'd be happy. Otherwise I will
place the patch on the patch tracker in (let's say) a week.

Thanks in advance for any help in order to bring this into matplotlib.

+

If you setup your validate func properly in rcsetup, you can guarantee
that each of these keymap.* entries will be a list of strings, even
those changes interactively from the prompt. So I suggest changing
each of these key entries to have a validate_stringlist validator and
then you won't need this check.

Thanks,
JDH

Hi John,

thanks a lot for taking the time to go through this patch. I tried to
incorporate you remarks and attached a new patch.
The most difficult task is about the
documentation 'mpl/doc/users/navigation_toolbar.rst', because I'm not sure
what is needed and I not familiar with the used programming language.

Kind regards,
Matthias

keymap_revisted2.patch (8.47 KB)

···

On Wednesday 17 February 2010 15:28:24 John Hunter wrote:

On Wed, Feb 17, 2010 at 8:08 AM, Matthias Michler > > <MatthiasMichler@...361...> wrote:
> Hi list, Hi Gökhan,
>
> I once more would like to say that I like the 2 new features introduced
> by Gökhan (key 'k' for xscaling and the generalized handling of the
> key-mapping, which allows the user to choose its prefered key for a
> certain task) and I'd like to see this in matplotlib.
>
> I attached a patch (against todays svn) of my final version, which is a
> slightly modified version of Gökhans patch.
>
> If anybody could test it and comments on this I'd be happy. Otherwise I
> will place the patch on the patch tracker in (let's say) a week.
>
> Thanks in advance for any help in order to bring this into matplotlib.

Hi -- these look like useful changes. In most of matplotlib rc we
have a namespace for the rc keys, so I prefer something like

  keymap.fullscreen : f # toggling
  keymap.home : h, r, home # home or reset mnemonic

Also, could you include in your patch a diff against

  mpl/doc/users/navigation_toolbar.rst

documenting the changes.

Also, I'm not sure you need

+ # to get a common standard we move all keys for each action into a
list + for key in [fullscreen_keys, home_keys, back_keys,
forward_keys, + pan_keys, zoom_keys, save_keys,
grid_keys,
+ toggle_xscale_keys, toggle_yscale_keys, all]:
+ if type(key) is not list:
+ key = list(key)
+

If you setup your validate func properly in rcsetup, you can guarantee
that each of these keymap.* entries will be a list of strings, even
those changes interactively from the prompt. So I suggest changing
each of these key entries to have a validate_stringlist validator and
then you won't need this check.

Hey mattias,

I just committed this to svn HEAD. I tested the L key on WXAgg, TkAgg
and Qt4Agg and it is working on all but WXAgg. Some wx expert may
want to look and make sure that the shifted keys are getting properly
recognized on wx.

As for the docs in mpl/doc/users/navigation_toolbar.rst, the language
is sphinx and restructured text

  http://sphinx.pocoo.org/rest.html

It looks like you got it right by following the pattern. This is the
document used to generate the mpl html and pdf documentation, eg

  http://matplotlib.sourceforge.net/users/navigation_toolbar.html

Thanks again!
JDH

···

On Wed, Feb 17, 2010 at 9:06 AM, Matthias Michler <MatthiasMichler@...361...> wrote:

thanks a lot for taking the time to go through this patch. I tried to
incorporate you remarks and attached a new patch.
The most difficult task is about the
documentation 'mpl/doc/users/navigation_toolbar.rst', because I'm not sure
what is needed and I not familiar with the used programming language.

thanks a lot for taking the time to go through this patch. I tried to

incorporate you remarks and attached a new patch.

The most difficult task is about the

documentation ‘mpl/doc/users/navigation_toolbar.rst’, because I’m not sure

what is needed and I not familiar with the used programming language.

Hey mattias,

Thanks John adding this feature into the code-base. Also Matthias thanks for your additions and keeping the subject hot :slight_smile:

I just committed this to svn HEAD. I tested the L key on WXAgg, TkAgg

and Qt4Agg and it is working on all but WXAgg. Some wx expert may

want to look and make sure that the shifted keys are getting properly

recognized on wx.

L is working for me both for Qt4Agg and WXAgg.

For some reason I can’t make “f” key toggling the fullscreen. It does nothing -no error messages and no life sign. Any confirmation?

Lastly, I know “s” behaviour is also being discussed in another thread, and I have seen with WXAgg it raises a not implemented error. I think “s” could simply bring the save dialogue instead of showing those messages. What do you think?

As for the docs in mpl/doc/users/navigation_toolbar.rst, the language

is sphinx and restructured text

http://sphinx.pocoo.org/rest.html

It looks like you got it right by following the pattern. This is the

document used to generate the mpl html and pdf documentation, eg

http://matplotlib.sourceforge.net/users/navigation_toolbar.html

Thanks again!

JDH

I see that you also updated the documentation. I was waiting for someone to take a look at the code before making changes there. Thanks again.

···

On Wed, Feb 17, 2010 at 9:28 AM, John Hunter <jdh2358@…83…287…> wrote:

On Wed, Feb 17, 2010 at 9:06 AM, Matthias Michler > > <MatthiasMichler@…361…> wrote:


SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,

Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW

http://p.sf.net/sfu/solaris-dev2dev


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Gökhan