bug in NavigationToolbar2QT ?

I have noticed that in the NavigationToolbar2QT there is a small display of x,y coordinates at the rightmost corner of the toolbar.

However, when using Axes.set_ticklabels, for example, to normalize through the labels and not through the data itself or to make a reciprocal scale - set locations and labels, the display of coordinates is lost.

I have attached the example “embedding in qt4” with minimal additions to show this.
Notice how the x coordinate is still alive in the bottom toolbar, while the y coordinate isn’t.

I haven’t found any way in the documentation to tell the navigation toolbar anything related to this change.

This isn’t crucial in any way, just a pity that it is not working properly.

Miki

My operating system is Windows XP.
matplotlib version 0.98.5.2 on python 2.5 installed by the standard binary installer.

embedding_in_qt4.py (4.17 KB)

My understanding is that that behavior is deliberate. If the tick labels are changed to something completely arbitrary, how can the toolbar know what to display?

Mike

Michael Dovrat wrote:

···

I have noticed that in the NavigationToolbar2QT there is a small display of x,y coordinates at the rightmost corner of the toolbar.

However, when using Axes.set_ticklabels, for example, to normalize through the labels and not through the data itself or to make a reciprocal scale - set locations and labels, the display of coordinates is lost.

I have attached the example "embedding in qt4" with minimal additions to show this.
Notice how the x coordinate is still alive in the bottom toolbar, while the y coordinate isn't.

I haven't found any way in the documentation to tell the navigation toolbar anything related to this change.

This isn't crucial in any way, just a pity that it is not working properly.

Miki

My operating system is Windows XP.
matplotlib version 0.98.5.2 on python 2.5 installed by the standard binary installer.

------------------------------------------------------------------------

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

There are some cases where we could be smarter about this, notably the
case you mention and when we are using date formatters. The essence
of the problem is that mpl uses the matplotlib.ticker.Formatter
instance, the thing that converts values to strings for the tick
locations, for the navigation toolbar. When you specify fixed labels,
we use a special Formatter to convert those locations to the specified
strings. If you mouse over a region where there is a tick, you will
probably see the toolbar flash the tick label.

The easiest workaround is to set the fmt_xdata and fmt_ydata
attributes of the axes. Eg::

   ax.fmt_xdata = lambda x: '%1.4f'%x

Then your toolbar will format the x location with 4 digits of precision.

JDH

···

On Tue, Jan 20, 2009 at 7:17 AM, Michael Droettboom <mdroe@...86...> wrote:

My understanding is that that behavior is deliberate. If the tick
labels are changed to something completely arbitrary, how can the
toolbar know what to display?

Mike

Michael Dovrat wrote:

I have noticed that in the NavigationToolbar2QT there is a small
display of x,y coordinates at the rightmost corner of the toolbar.

However, when using Axes.set_ticklabels, for example, to normalize
through the labels and not through the data itself or to make a
reciprocal scale - set locations and labels, the display of
coordinates is lost.

I have attached the example "embedding in qt4" with minimal additions
to show this.
Notice how the x coordinate is still alive in the bottom toolbar,
while the y coordinate isn't.

I haven't found any way in the documentation to tell the navigation
toolbar anything related to this change.

This isn't crucial in any way, just a pity that it is not working
properly.