By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,676 Members | 2,262 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,676 IT Pros & Developers. It's quick & easy.

dislin titlin and string decode

P: n/a
Hello!

I have an unespectedn result with dislin titlin

dislin.metafl ('WMF')
dislin.disini ()

.....
a="Andrés or Ramón"
dislin.titlin (a.encode("Latin-1"), 1)
# not error raised, is ok
.....

dislin.disfin ()
In the output file all is ok but the title is

Andr s or Ram n

Thanks in advance!

May 19 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
the code is:

#!/usr/bin/env python

def try_dislin():
....import dislin
....dislin.metafl ('WMF')
....dislin.errdev ('FILE')
....dislin.disini ()
....dislin.errmod('PROTOCOL','ON')
....dislin.hwfont ()
....dislin.pagera ()
....dislin.pagfll (255)

....dislin.color('BLACK')
....dislin.axspos (500, 1600)
....dislin.axslen (2200, 1200)
....
....dislin.name...('x','X')
....dislin.name...('y','Y')
....
....dislin.ticks (10, 'X')
....dislin.ticks (10, 'Y')

....dislin.labels ('FLOAT','X')
....dislin.labels ('FLOAT','Y')

....dislin.incmrk(1)
....dislin.hsymbl (15)
....dislin.chacod('STANDARD')
....dislin.polcrv('LINEAR')

....x=[1.,2.,3.]
....y=[1.,2.,3.]
..........
....a=unicode("Ramón y Andrés",'Latin-1')
....dislin.titlin (a.encode('Latin-1'), 1)
....
....min_x_axis=1.
....max_x_axis=3.
....min_y_axis=1.
....max_y_axis=3....
....
....xstep=(max_x_axis - min_x_axis)/10.
....ystep=(max_y_axis - min_y_axis)/10.
....dislin.graf (min_x_axis,max_x_axis,min_x_axis,xstep \
.......,min_y_axis,max_y_axis,min_y_axis,ystep)
....
....dislin.title()
....

....dislin.curve(x,y, len(x))

....dislin.color ('foreground')
....dislin.dash...()
....dislin.xaxgit ()
....dislin.disfin ()
try_dislin()
print 'end'

May 19 '07 #2

P: n/a
On 19 mayo, 12:56, luis <soli...@gmail.comwrote:
Hello!

I have an unespectedn result with dislin titlin

dislin.metafl ('WMF')
dislin.disini ()

....
a="Andrés or Ramón"
dislin.titlin (a.encode("Latin-1"), 1)
# not error raised, is ok
....

dislin.disfin ()

In the output file all is ok but the title is

Andr s or Ram n

Thanks in advance!
The problem was the value of dislin.chacod. This must be 'ISO1' not
the default ('STANDAR')

May 19 '07 #3

P: n/a
En Sat, 19 May 2007 18:28:51 -0300, luis <so*****@gmail.comescribió:
The problem was the value of dislin.chacod. This must be 'ISO1' not
the default ('STANDAR')
I used to use DISLIN some time ago, but now I use PyChart most of the
time. Its convoluted interfase (mostly due to Fortran support, I guess)
makes it rather "ugly" to use from Python. (And has a very strange
licence, btw.)

--
Gabriel Genellina

May 19 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.