Hello,
Is there a way to change the resolution of x and y readings (while hovering the mouse inside the canvas area) from the status bar of a plot window?
Currently x show 2 or 3 digits after 0, while y only increments at 0.1 or 1 depends on the number.
Can we set these based on our needs?
Thank you.
Gökhan
There are attributes ax.fmt_xdata and ax.fmt_ydata. These are None by
default, in which case the axis tick formatter is used. Write the
function you want to format the data, and set the attr to override the
default
def myformat(x):
return '%1.4f'%x
ax.fmt_xdata = myformat
JDH
···
On Wed, May 13, 2009 at 1:39 PM, Gökhan SEVER <gokhansever@...287...> wrote:
Hello,
Is there a way to change the resolution of x and y readings (while hovering
the mouse inside the canvas area) from the status bar of a plot window?
Currently x show 2 or 3 digits after 0, while y only increments at 0.1 or 1
depends on the number.
Can we set these based on our needs?
Hmm, Thank you for the guidance John
def myformat(x):
return ‘%1.2f’%x
axes().fmt_xdata = myformat works like you said.
How can I join x and y in one function? The following line gives me a syntax error.
def myformat(x, y):
return ‘%1.2f’%x, ‘%1.2f’%y
axes().(fmt_xdata, fmt_ydata) = myformat
Since the function will return a tuple with two values could they be assigned directly in the give fashion?
Gökhan
···
On Wed, May 13, 2009 at 1:50 PM, John Hunter <jdh2358@…83…287…> wrote:
On Wed, May 13, 2009 at 1:39 PM, Gökhan SEVER <gokhansever@…1896…> wrote:
Hello,
Is there a way to change the resolution of x and y readings (while hovering
the mouse inside the canvas area) from the status bar of a plot window?
Currently x show 2 or 3 digits after 0, while y only increments at 0.1 or 1
depends on the number.
Can we set these based on our needs?
There are attributes ax.fmt_xdata and ax.fmt_ydata. These are None by
default, in which case the axis tick formatter is used. Write the
function you want to format the data, and set the attr to override the
default
def myformat(x):
return '%1.4f'%x
ax.fmt_xdata = myformat
JDH
There is no support for this currently, sorry
JDH
···
On Wed, May 13, 2009 at 2:15 PM, Gökhan SEVER <gokhansever@...287...> wrote:
Hmm, Thank you for the guidance John
def myformat(x):
return '%1.2f'%x
axes().fmt_xdata = myformat works like you said.
How can I join x and y in one function? The following line gives me a syntax
error.
def myformat(x, y):
return '%1.2f'%x, '%1.2f'%y
axes().(fmt_xdata, fmt_ydata) = myformat
Since the function will return a tuple with two values could they be
assigned directly in the give fashion?
Nop John,
I was just wondering whether my assignment syntactically correct in Python or a missing feature in matplotlib.
Gökhan
···
On Wed, May 13, 2009 at 2:23 PM, John Hunter <jdh2358@…83…287…> wrote:
On Wed, May 13, 2009 at 2:15 PM, Gökhan SEVER <gokhansever@…287…> wrote:
Hmm, Thank you for the guidance John
def myformat(x):
return '%1.2f'%x
axes().fmt_xdata = myformat works like you said.
How can I join x and y in one function? The following line gives me a syntax
error.
def myformat(x, y):
return '%1.2f'%x, '%1.2f'%y
axes().(fmt_xdata, fmt_ydata) = myformat
Since the function will return a tuple with two values could they be
assigned directly in the give fashion?
There is no support for this currently, sorry
JDH