Dear all,
I would like to add a scalebar in my shapeplot before exporting it to a postscript. How could I do this?
Thanks a lot, Martine
scalebar in shapeplot
-
- Site Admin
- Posts: 6305
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: scalebar in shapeplot
Create a section with known length. If you want to get fancy, cap it at each end with short sections at right angles, like so
|_____|
Assign values to these symbolic constants
BARX, BARY, BARL, CAPL
which are, respectively, the x,y coords of the origin of the scalebar, length of the scalebar, and length of the end caps. Then this code will do what you want:
|_____|
Assign values to these symbolic constants
BARX, BARY, BARL, CAPL
which are, respectively, the x,y coords of the origin of the scalebar, length of the scalebar, and length of the end caps. Then this code will do what you want:
Code: Select all
create scalebar, endcaps[2]
for i=0,1 {
connect endcap[i](0), scalebar(i)
}
scalebar {
pt3dclear()
pt3dadd(BARX, BARY, 0, 1)
pt3dadd(BARX + BARL, BARY, 0, 1)
}
for i=0,1 endcap[i] {
pt3dclear()
pt3dadd(0, 0, 0, 1)
pt3dadd(0, CAPL, 0, 1)
}