from jhplot import *
from net.sf.drawj2d import Drawj2d
f="drawing.hcl"
out="drawing.svg"
s="""
unitlength [/ 1. 40.] m
set O {0 0}
set r 1
set T -30
set R [geom.polar 0]
set P [geom.polar $T]
m $O
pen lightgray
fillsector $r $T 0
pen black 0.3
circle $r
line $R $O $P
dot $O
dot $R
tlb "([nf [X $R] 0], [nf [Y $R] 0])" E
dot $P
"""
with open(f, "w") as xfile:
xfile.write(s)
args=["-T" "svg", "-W", "60", "-H", "40", "-o", out, f]
Drawj2d.Run(args)
IViewSVG(out)