dislin titlin and string decode

L

luis

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!
 
L

luis

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'
 
L

luis

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')
 
G

Gabriel Genellina

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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top