scalebar in shapeplot

Managing anatomically complex model cells with the CellBuilder. Importing morphometric data with NEURON's Import3D tool or Robert Cannon's CVAPP. Where to find detailed morphometric data.
Post Reply
tine
Posts: 10
Joined: Thu Jan 13, 2011 2:18 pm

scalebar in shapeplot

Post by tine »

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
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: scalebar in shapeplot

Post by ted »

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:

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)
}
Post Reply