469,949 Members | 2,680 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,949 developers. It's quick & easy.

dislin titlin and string decode

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
3 2052
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
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
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.

Similar topics

2 posts views Thread by Gaubitzer Erwin | last post: by
1 post views Thread by Karin Lagesen | last post: by
2 posts views Thread by Tom Richardson | last post: by
5 posts views Thread by eesun | last post: by
6 posts views Thread by Richard | last post: by
1 post views Thread by adolfo | last post: by
3 posts views Thread by adolfo | last post: by
reply views Thread by Helmut Michels | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.