I am new to PyX and am trying to use it for illustrations in my
thesis.  It seems really powerful.

I am trying to draw and arc with arrows on both ends to illustrate a
swinging motion.

my script starts with

from pyx import *

myasize=0.5
text.set(mode="latex")
#text.preamble(r"\usepackage{palatino}")
myarrow=deco.arrow(size=myasize)
myearrow=deco.earrow(size=myasize)
myblue=color.rgb(b=0.8,g=0.05)
mylinestyle=style.linewidth.Thick

and I later define
mylinewarrows=[mylinestyle,myarrow,myearrow,myblue]

this works great for straight lines but when I try:
myarc=path.arc(2.5,8.2,4,250,285)
#c.stroke(myarc,[myblue,mylinestyle])
c.stroke(myarc,mylinewarrows)

I get
Traceback (most recent call last):
  File "setup_pic.py", line 34, in ?
    c.stroke(myarc,mylinewarrows)
  File "/usr/lib/python2.4/site-packages/pyx/canvas.py", line 241, in stroke
    self.draw(path, [deco.stroked]+list(attrs))
  File "/usr/lib/python2.4/site-packages/pyx/canvas.py", line 227, in draw
    dp = adeco.decorate(dp)
  File "/usr/lib/python2.4/site-packages/pyx/deco.py", line 440, in decorate
    dp.ensurenormpath()
  File "/usr/lib/python2.4/site-packages/pyx/deco.py", line 74, in
ensurenormpath
    self.path = self.path.normpath()
AttributeError: 'arc' object has no attribute 'normpath'

Note that it works fine if I switch to
c.stroke(myarc,[myblue,mylinestyle])
but then I have no arrows, which I really need.

Otherwise my illustration looks good.

How do I combined an arc with arrows?

Thanks,

Ryan


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to