wx.lib.plot:override ticks methods to customize labels.

40 views
Skip to first unread message

beppe

unread,
Aug 14, 2014, 1:15:21 PM8/14/14
to wxpytho...@googlegroups.com

hi all,
arising from a post of the 2008 of Mike Rooney that you can read here.

http://wxpython-users.1045709.n5.nabble.com/wx-lib-plot-custom-labels-td2366602.html


I have made this small demo, to show as is possible, in the limits of wx.libplot, to customize the axis labels.
I would like one comment of yours.
I' have  attached the code.

regards
beppe
sample_app.py

Nathan McCorkle

unread,
Aug 14, 2014, 2:29:29 PM8/14/14
to wxpytho...@googlegroups.com
I changed pysimpleapp to App and also had to add:
# -*- coding: utf-8 -*-

at the top of the file, but I don't see the celsius symbol.

Werner

unread,
Aug 15, 2014, 1:51:30 AM8/15/14
to wxpytho...@googlegroups.com
You need to use to define the string as Unicode for that to work, if you
do that then you also need an encoding line and the hack I added at the
beginning if you are on Python 2.x (by default it is in ASCII).

BTW, your Python shebang was incorrect.

Werner
plotcanvas-2.py

beppe

unread,
Aug 15, 2014, 2:44:21 AM8/15/14
to wxpytho...@googlegroups.com

thank Werner for suggestions,
anyway, I'm on debian 6 and when I run your script I recive

Traceback (most recent call last):
  File "/home/pep/Downloads/plotcanvas-2.py", line 22, in <module>
    wxversion.select('2.9')
  File "/usr/lib/python2.6/dist-packages/wxversion.py", line 152, in select
    raise VersionError("Requested version of wxPython not found")
VersionError: Requested version of wxPython not found

that is right on my platform cause debian 6 have python 2.6.

change with
   wxversion.select('2.8')
it work


"You need to use to define the string as Unicode for that to work, if you
do that then you also need an encoding line and the hack I added at the
beginning if you are on Python 2.x (by default it is in ASCII). "

my idle have Default Source Encoding on UTF-8 but you are right on use
u" %s ºC" that's  my mistake.
even shebang is another error.

regards
beppe

 
Reply all
Reply to author
Forward
0 new messages