Adding a Calbar to Figures

Anything that doesn't fit elsewhere.
Post Reply
iamdescartes
Posts: 4
Joined: Wed Jul 25, 2012 1:31 pm

Adding a Calbar to Figures

Post by iamdescartes » Wed Jul 31, 2013 2:57 pm

Hi all,

I am wondering how I can add a calibration bar to a plot in NEURON. I want to just show the trace without the axes (which I can do by clicking the 'hide axis' command) and have a small line segment in a corner illustrating the x and y scales. Can this be done easily? Thanks in advance! I really appreciate it.

Anthony

ted
Site Admin
Posts: 5601
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Adding a Calbar to Figures

Post by ted » Wed Jul 31, 2013 5:07 pm

Code: Select all

/*
$o1 objref that points to Graph that is to be marked with a vertical cal bar
$2,$3 origin of cal bar
$4 length of cal bar
$5 line style
*/
proc makecal() {
  $o1.beginline(1,$5) // 1 for black
  $o1.line($2,$3)
  $o1.line($2,$3+$4)
  $o1.flush()
}
Example: if g is an objref that points to an instance of the Graph class,
makecal(g, 0,0, 1, 2)
draws a black vertical line with origin (0,0), length 1, and line style 2.

Post Reply