Jaffe & Carnevale 1999 code

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.
Corinne
Posts: 38
Joined: Wed Feb 09, 2011 7:13 pm

Jaffe & Carnevale 1999 code

Post by Corinne »

Hi Ted,

I would like to plot a graph much like figure 4D in your paper "Transfer impedance and synaptic integration". I can't find that code on modelDB. Is there a way I can get a hold of it, or do you know of another code that does similar things I can take a look at?

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

Re: Jaffe & Carnevale 1999 code

Post by ted »

Assuming the existence of a model that satisfies these criteria:

--root section is called soma
--biophysical properties have been specified
--spatial discretization is sufficiently fine for desired accuracy
--basilar dendrites have been appended to a SectionList called basilars
--apical dendrites have been appended to a SectionList called apicals
--the connect statements are such that the 1 end of each section is its distal end
--model can be initialized to a stable resting potential

then here is a solution in semi-pseudocode:

Code: Select all

First build a toy model with just enough complexity to be used as a test case. A stylized model consisting of an axon, soma, and dendrite will suffice. Attach an AlphaSynapse to one of its sections and assign reasonable parameters to this mechanism.

Next define a procedure called onepoint that expects two arguments and does the following:
  calls a procedure that moves synapse to $2 
    in currently accessed section (can use putsyn.hoc for this--
    see http://www.neuron.yale.edu/neuron/static/courses/2008/course/family/putsyn.ho
    --but will have to change the statement
      dend AlphaSynapse[0].loc($1)
    to
      AlphaSynapse[0].loc($1)
    )
  runs a simulation with tstop sufficiently large
    that soma.v(0) will have reached its peak
  calls a procedure that finds the amplitude of the somatic epsp
  calculates distance from this node to soma(0)
  appends epsp amplitude and $1*distance($2) to ampvec and distvec, respectively

Then write additional code that does the following:
  sets up Vector recording of soma.v(0)
  creates a pair of Vectors called distvec and ampvec
    distvec will hold distance between soma(0) and each node in cell
    ampvec will hold amplitude of somatic epsp
      produced by a synapse at those locations
  makes soma the currently accessed section
  attaches a synapse to 0 end of currently accessed section
  uses distance() to specify soma(0) as origin for path distances
  // take care of all nodes in soma
  for (x) onepoint(1, x)
  // deal with all nodes in basilars
  for each section in basilars
    for (x) if (x>0) onepoint(-1, x)
  // deal with all nodes in apicals
  for each section in apicals
    for (x) if (x>0) onepoint(1, x)
  normalize the amplitudes in ampvec
  plot ampvec vs. distvec
Revised 8/31/2011. Original version would have plotted actual epsp amplitude vs. distance to synapse. This version plots normalized epsp amplitude, as did Fig. 4 in Jaffe and Carnevale J. Neurophysiol. 82:3268, 1999.
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Jaffe & Carnevale 1999 code

Post by ted »

Here is code for a test model cell with three sections called bas, soma, and ap, connected like so: bas--soma--ap

Code: Select all

// topology
create soma, bas, ap
access soma
connect ap(0), soma(1)
connect bas(0), soma(0)

// subsets
objref apicals, basilars
apicals = new SectionList()
basilars = new SectionList()
ap apicals.append()
bas basilars.append()

// geometry
soma {
  diam = 15
  L = 15
  nseg = 1
}
ap {
  diam = 2.5
  L = 3000
  nseg = 69 // appropriate for d_lambda 0.1, given cm and Ra
}
bas {
  diam = 1
  L = 1000
  nseg = 37 // appropriate for d_lambda 0.1, given cm and Ra
}

// biophysics
forall {
  cm = 1 // uf/cm2
  Ra = 100 // ohm cm
  insert pas
  g_pas = 2e-5 // S/cm2
  // resting membrane potential will equal e_pas = -70 mV
}
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Jaffe & Carnevale 1999 code

Post by ted »

Here is a program that will load the model cell, then march a synapse over all nodes in the model to find the maximum somatic depolarization elicited from each synaptic location, and finally plot normalized somatic epsp amplitude vs. synaptic distance from the origin of the model (origin is soma(0), basilar locations have negative distances, apical locations have positive distances). Note that some revision would be necessary to accommodate cells that have more than one somatic section, and cells that have nonuniform resting potential.

Code: Select all

load_file("nrngui.hoc")

TSTOP = 50 // long enough for even the slowest somatic epsp to peak
V_INIT = -70 // resting potential of model cell

load_file("cell.hoc")

///// instrumentation

objref syn
soma syn = new AlphaSynapse(0) // make soma(0) the "reference point"
syn.onset = 1 // ms
syn.tau = 1 // ms
syn.gmax = 1e-4 // uS
syn.e = 0 // mV

objref vsoma
vsoma = new Vector() // for recordings of vsoma
soma vsoma.record(&v(0)) // record soma.v(0) waveform

///// simulation control code

tstop = TSTOP
v_init = V_INIT

objref ampvec, distvec
ampvec = new Vector() // for soma psp amplitudes
distvec = new Vector() // for synaptic distances from soma(0)
soma distance() // make soma(0) the origin for distance measurements

// $1 is 1 or -1 (specifies whether distance should be - or +)
//   i.e. is syn on a basilar or an apical dendrite
// $2 is location of node in currently accessed section
proc onepoint() { local vmax
  syn.loc($2) // move syn to currentsection($2)
//  print secname(), " ", $2 // to verify proper operation of program
  distvec.append($1*distance($2))
  run()
  // assumes that cell was initialized to resting steady state!
  vmax = vsoma.max() - vsoma.x[0] // extract psp amplitude from waveform
  ampvec.append(vmax)
}

objref g // for Graph that shows results

proc allpoints() { local vmax
  // throw out old results
  ampvec = new Vector()
  distvec = new Vector()
  // deal with all neurites
  printf("Working")
  soma for(x) {
    onepoint(1,x)
    printf(".") // indicate progress
  }
  forsec basilars for (x) if (x>0) {
    onepoint(-1,x)
    printf(".")
  }
  forsec apicals for (x) if (x>0) {
    onepoint(1,x)
    printf(".")
  }
  printf("done!\n")
  // normalize amplitudes
  vmax = ampvec.max()
  ampvec.div(vmax)
  g = new Graph()
  ampvec.mark(g, distvec, "O", 5) // medium small black filled circle
  g.exec_menu("View = plot") // autoscale axes
}

allpoints()
Corinne
Posts: 38
Joined: Wed Feb 09, 2011 7:13 pm

Re: Jaffe & Carnevale 1999 code

Post by Corinne »

Thank you, this was very helpful to get me started. I do have a couple more questions.

I succeeded in getting your code working on my own morphologies. However I am trying to tweak the code to do something similar and I realize I don't understand some things. The code you provided creates a plot of the voltage at the soma when a synapse is at some distance from the soma. I would like to change the reference point to a segment on a dendrite and then measure the maximal voltage deflection at each segment some distance away from the reference segment as the result of a synapse at the reference segment. I.e. I am trying to see how a synapse placed at a particular location effects the voltage of other regions of the neuron.

In order to do this, I need to change the reference segment and instead of measuring the voltage deflection at the soma and marching though and placing a synapse at every segment in the neuron, I want to place a synapse somewhere and then march through and measure the maximal voltage deflection at every segment in the neuron. Instead of the distances being positive for apical locations and negative for basal locations, all the segments on one side of the reference section will be positive and everything on the other side will be negative. Below I give it my best shot. My cell.hoc file consists of the cell you used in Figure 4 of your paper. I found it on neuromorpho.org at http://neuromorpho.org/neuroMorpho/neur ... me=5038801 . I uploaded it into NEURON using Import 3D and then exported it to a hoc file. I got around the error of the single point soma via your recommendation at
http://www.neuron.yale.edu/phpBB/viewto ... ypes#p8782. Then I changed the names of the SectionList to be called apicals and basilars to match your code. So far so good as I use this to recreate Figure 4D and it works.

Then I go on to try to alter the instrumentation. I choose to try to use apic[43] as the reference section and the location of the synapse. In the first block I change the reference point from soma to apic[43] although it doesn't have any effect when I run the code. I also change vsoma to be called vseg since I am no longer measuring the the voltage exclusively at the soma:

Code: Select all

    ///// instrumentation
    objref syn
    apic[43] syn = new AlphaSynapse(0) // make soma(0) the "reference point"  CHANGED THIS FROM SOMA TO APIC[43] BUT IT DIDNT DO ANYTHING
    syn.onset = 1 // ms
    syn.tau = 1 // ms
    syn.gmax = 500e-6 // uS
    syn.e = 0 // mV 

    objref vseg
    vseg = new Vector() // for recordings of voltage at a segment
Then in the next section I change the origin for the distance measurements to apic[43]. This does do something.

Code: Select all

    tstop = TSTOP
    v_init = V_INIT

    objref ampvec, distvec
    ampvec = new Vector() // for soma psp amplitudes
    distvec = new Vector() // for synaptic distances from soma(0)
    apic[43] distance() // make apic[43](0) the origin for distance measurements
Now comes the onepoint() procedure which I don't quite understand. I think I can get rid of the syn.loc line since I no longer have to move the synapse. I think the distvec command will still work since I specified apic[43] as the reference section above. I assume vseg (which was vsoma) needs to marched through --in order to do this, I am guessing that vseg needs to be the current section but I am not sure how specify that. Also, I am not completely sure what the .x[0] means in vseg.x[0]--does this mean the voltage at time = 0? If the .x specifies the section number, then why does vseg.max() work without specifying a section number?

Code: Select all

   proc onepoint() { local vmax  
     // syn.loc($2) // move syn to currentsection($2) //NO LONGER HAVE TO DO THIS
    //  print secname(), " ", $2 // to verify proper operation of program
      distvec.append($1*distance($2))  //I THINK THIS WILL STILL WORK
      run()
      // assumes that cell was initialized to resting steady state!
      vmax = vseg.max() - vseg.x[0] // extract psp amplitude from waveform
      ampvec.append(vmax)
}
Specifying g happens as normal:

Code: Select all

    objref g // for Graph that shows results
Then comes the allpoints() procedure. I am not sure why you are throwing out the ampvec and the distvec. Then you move on to 'soma for(x)'--I assume x is being counted though but I am not quite sure: does x always mean all segments or sections? Now I need to specify the upstream and downstream segments from my reference point. For my current reference point (apic[43]) apic [44], [45], [46], and [47] are upstream (should be positive numbers) and everything else is downstream (should be negative). Below is my best guess.

Code: Select all

   proc allpoints() { local vmax
      // throw out old results
      ampvec = new Vector() 
      distvec = new Vector()
      // deal with all neurites
      printf("Working")
//looks like below makes things positive or negative
      soma for(x) {
        onepoint(1,x)
        printf(".") // indicate progress
      }
      forsec basilars for (x) if (x>0) {
        onepoint(-1,x)
        printf(".")
      }
forsec apicals for(x) if (x==44 || x==45 || x==46 || x==47){ \\ right here I am trying to say x can equal 44 or 45 or 46 or 47
        onepoint(1,x)
        printf(".")
      }

      forsec apicals for (x) if (x!=44||45||46||47){ \\  trying to say NOT 44 or 45 or 46 or 47
        onepoint(-1,x)
        printf(".")
      }
      printf("done!\n")

      // normalize amplitudes
      vmax = ampvec.max()
      ampvec.div(vmax)
      g = new Graph()
      ampvec.mark(g, distvec, "O", 5) // medium small black filled circle
      g.exec_menu("View = plot") // autoscale axes
    }
When I run my current version I get the following error:

Code: Select all

rniv: subscript out of range x
     allpoints()  
                  ^
        onepoint(1, 0)
      allpoints()
Any guidance you are willing to provide would be much appreciated. Thank you in advance!
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Jaffe & Carnevale 1999 code

Post by ted »

I would like to change the reference point to a segment on a dendrite and then measure the maximal voltage deflection at each segment some distance away from the reference segment as the result of a synapse at the reference segment. I.e. I am trying to see how a synapse placed at a particular location effects the voltage of other regions of the neuron.
Easily done. This mechanism keeps track of the maximum depolarization and maximum epsp amplitude in each section into which it is inserted:

Code: Select all

NEURON {
  SUFFIX max
  RANGE v0, vm, vepsp
}

ASSIGNED {
  v (millivolt)
  vm (millivolt)
  v0 (millivolt)
  vepsp (millivolt)
}

INITIAL {
  v0 = v
  vm = v
  vepsp = vm - v0
}

BREAKPOINT { 
  if (v > v0) {
    vm = v
    vepsp = vm - v0
  }
}
All it takes to use it is
forall insert max
after your model setup code has been executed, and make sure that the site of synapse attachment is the reference point for distance measurements. Then after a run, you only have to do the following:

Code: Select all

objref g
g = new Graph()
forall for (x) g.mark(distance(), vepsp_max(x), "O", 5)
g.exec_menu("View = plot")
BUG ALERT! The NMODL source code in this post contains several bugs (at least 3)! Can you identify them? See my post from September 26, 2011 for a debugged version.
--Ted
Corinne
Posts: 38
Joined: Wed Feb 09, 2011 7:13 pm

Re: Jaffe & Carnevale 1999 code

Post by Corinne »

Sorry Ted, I don't quite get it--sorry to be so slow on the uptake.

Are you saying that I can run your original code but then add a 'forall insert max' at the bottom (after compiling the max.mod file) and then a set of graphing commands? Or am I supposed to use the code I altered (which also errored) with the additional 'forall insert max' at the bottom and then a set of graphing commands?

I am not sure how to change the reference distance correctly. In the original code you have:
soma distance() // make soma(0) the origin for distance measurements
Is this what I change? Should I also comment out the syn.loc($2) so the synapse stays in the same place?

This is what I currently have for use with your simple cell.hoc above. The output doesn't look correct.

Code: Select all

///// instrumentation

objref syn
ap syn = new AlphaSynapse(.5) // place a synapse at x=.5 on the ap section.
syn.onset = 1 // ms
syn.tau = 1 // ms
syn.gmax = 1e-4 // uS
syn.e = 0 // mV

objref vsoma
vsoma = new Vector() // for recordings of vsoma
soma vsoma.record(&v(0)) // record soma.v(0) waveform

///// simulation control code

tstop = TSTOP
v_init = V_INIT

objref ampvec, distvec
ampvec = new Vector() // for soma psp amplitudes
distvec = new Vector() // for synaptic distances from soma(0)
ap distance(.5) // want to make apical(.5) the origin for distance measurements  This doesn't work but I am not sure why

// $1 is 1 or -1 (specifies whether distance should be - or +)
//i.e. is syn on a basilar or an apical dendrite
// $2 is location of node in currently accessed section
proc onepoint() { local vmax
//syn.loc($2) // move syn to currentsection($2)
// print secname(), " ", $2 // to verify proper operation of program
 distvec.append($1*distance($2))
 run()
 // assumes that cell was initialized to resting steady state!
 vmax = vsoma.max() - vsoma.x[0] // extract psp amplitude from waveform
 ampvec.append(vmax)
}

objref g // for Graph that shows results

proc allpoints() { local vmax
 // throw out old results
 ampvec = new Vector()
 distvec = new Vector()
 // deal with all neurites
 printf("Working")
 soma for(x) {
 onepoint(1,x)
 printf(".") // indicate progress
 }
 forsec basilars for (x) if (x>0) {
 onepoint(-1,x)
 printf(".")
 }
 forsec apicals for (x) if (x>0) {
 onepoint(1,x)
 printf(".")
 }
 printf("done!\n")
 // normalize amplitudes
 vmax = ampvec.max()
 ampvec.div(vmax)
 g = new Graph()
 ampvec.mark(g, distvec, "O", 5) // medium small black filled circle
 g.exec_menu("View = plot") // autoscale axes
}

allpoints()

forall insert max

objref h
h = new Graph()
forall for (x) h.mark(distance(), vepsp_max(x), "O", 5)
h.exec_menu("View = plot")
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Jaffe & Carnevale 1999 code

Post by ted »

Are you saying that I can run your original code but then add a 'forall insert max' at the bottom (after compiling the max.mod file) and then a set of graphing commands?
Actually, I was abandoning the code I posted on 8/31 because it does the following

1. execute code that sets up a model cell
2. march a synapse over all nodes in the model to find the maximum somatic depolarization elicited from each synaptic location
3. plot normalized somatic epsp amplitude vs. synaptic distance from the origin of the model (origin is soma(0)

which is nice but irrelevant to what you really wanted to do.

The mod file I posted on 9/3 is to be used in a program that determines peak PSP amplitude throughout a cell produced by a synapse attached to any point on the cell (not necessarily the soma). An outline of such a program is:
1. execute code that sets up a model cell
2. attach a synapse to a particular location on the cell, and make that location the reference point for distance measurements
3. insert the max mechanism into all sections
4. run a simulation
5. create a Graph
6. for each node in the model, plot a point on the graph at coordinates (peak psp amplitude, distance from synaptic location)

As I think about it, I realize that the for loop in step 6 must avoid the 0 and 1 ends of sections, because the value reported for a range variable at 0 or 1 will be the value at the nearest internal node. So the for loop should be
forall for (x,0) plot a point on the graph at coordinates (peak psp amplitude, distance from synaptic location)
I am not sure how to change the reference distance correctly.
Presumably that's because you were thinking about modifying the code from 8/31, but I was thinking of a fresh start. However, if you do have some questions about distance(), the best way to learn how it works is to re-read the Programmer's Reference entry about distance(). Then, if questions remain, make a toy model with just one or two sections of known lengths, and try some bits of code that use distance() and see if the results begin to make sense.

Since you may intend to place a synapse at an arbitrary location, you may want to use the get_loc() method to discover where it actually ended up. Remember that point processes can only be placed at nodes, i.e. if you try to place a point process at some location where there isn't a node, it will end up at the nearest internal node, at an arc distance that depeds on nseg. It may be useful to read the Programmer's Reference entry on get_loc()
http://www.neuron.yale.edu/neuron/stati ... ml#get_loc
Corinne
Posts: 38
Joined: Wed Feb 09, 2011 7:13 pm

Re: Jaffe & Carnevale 1999 code

Post by Corinne »

With regard to distance(), I was trying to play with a simple model to figure out what is going on:

Code: Select all

    create axon
    access axon
    {nseg = 5  L=1000}
    for (x) print x, distance(0,x)
Here the output is:
0 0
0.1 0.1
0.3 0.3
0.5 0.5
0.7 0.7
0.9 0.9
1 1

When I do

Code: Select all

for (x) print x, distance(1,x)
The output is
0 1000
0.1 900
0.3 700
0.5 500
0.7 300
0.9 100
1 0

This doesn't make sense to me. The second output seems correct--when the origin is at 1 and x is zero the distance is L=1000 and so on counting down in length. But the distance(0,x) doesn't seem correct-- shouldn't it be:
0 0
0.1 100
0.3 300
0.5 500
0.7 700
0.9 900
1 1000
???

Also if I want to set the origin at .5 I would guess I could do:

Code: Select all

for (x) print x, distance(.5,x)
But again I get:
0 0
0.1 0.1
0.3 0.3
0.5 0.5
0.7 0.7
0.9 0.9
1 1
Can I not set the origin at a node?

Also how do I set the origin to be in another segment?

In the following code (using the cell.hoc you provided a few posts ago) I attempt to put a synapse on the apical section at .5. Things appear to work however it looks like the distance is being measured from the soma instead of from the location of my synapse. Again I am not sure how set the origin to be at a specific node on a specific section.

Code: Select all

load_file("nrngui.hoc")

Tstop = 50 // long enough for even the slowest somatic epsp to peak
V_INIT = -70 // resting potential of model cell

load_file("cell.hoc")

///// instrumentation

objref syn
ap syn = new AlphaSynapse(.5) // place a synapse
syn.get_loc()
syn.onset = 1 // ms
syn.tau = 1 // ms
syn.gmax = 1 // uS
syn.e = 0 // mV

ap distance()	// I wish this is setting the origin midway in the apical section

forall insert max

run()

objref g
g = new Graph()
forall for (x,0) g.mark(distance(x), vepsp_max(x), "O", 5)
g.exec_menu("View = plot")
Thanks again for all of your help!
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Jaffe & Carnevale 1999 code

Post by ted »

The origin for distance measurements should be specified before trying to use the values returned by the distance function.
Also if I want to set the origin at .5 I would guess I
should first review the Programmer's Reference entry about "distance". That will answer all your other questions.
Corinne
Posts: 38
Joined: Wed Feb 09, 2011 7:13 pm

Re: Jaffe & Carnevale 1999 code

Post by Corinne »

Ted, I finally get it! I neglected to mention that all this time I had been repeatedly reading the Programmers Reference I just didn't understand it. Here is a summary of the distance function that is a bit more clear for me-- perhaps it will help someone else that maybe as confused as I was:

Two steps are needed to use the distance function. First you must set the origin (the point from which the distance will be calculated) which can be done by distance() which sets the origin to location 0 of the currently accessed section, or, if you would like the origin to be at a non 0 location use the syntax distance(0,x) where x is the location where you want the origin to be in the current section. Then to calculate distance from the origin, use distance(x) where x is the location on the current section where you want distance to be measured.

I have one more question. Is it also possible to put the information about the max EPSP on a shape plot with color corresponding to the max EPSP? I was thinking something that is almost like the default shape plot functionality except I don't want the voltage as a function of time. Just the maximum voltage deflection at every point on the neuron?

Thanks for all of your help! I really appreciate it.
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Jaffe & Carnevale 1999 code

Post by ted »

The Programmer's Reference tends to be so concise that understanding often comes only after some practice with working code. Explanations by others can only go so far--it often takes hands-on testing.

I find it helpful to stow away useful bits of code with comments that explain how they work, so that if in the future I need to do something but don't quite remember how, I can retrieve my own working code and comments.
Corinne wrote:Is it also possible to put the information about the max EPSP on a shape plot with color corresponding to the max EPSP? . . . the maximum voltage deflection at every point on the neuron?
Read about the PlotShape class. If you think distance() was a challenge, wait until you read the Programmer's Reference entry on this one. It's easy to set this up with the GUI--
NEURON Main Menu / Graph / Shape plot
then in the Shape window click in the menu box and select the item "Shape Plot"
--but even easier in hoc, where you can just execute
objref foo
foo = new PlotShape()

At the very least you'll want to use its variable() and scale() methods. There's also a colormap() method in case you want to use a custom color map.

Usage is pretty simple: run a simulation, create a PlotShape instance after it is finished, then specify that the variable to be plotted is the max voltage captured by that "max" mechanism whose code I posted, and finally specify the scale.
Corinne
Posts: 38
Joined: Wed Feb 09, 2011 7:13 pm

Re: Jaffe & Carnevale 1999 code

Post by Corinne »

Hi Ted,

I am trying to get the hoc commands working to plot the max mechanism using the PlotShape commands. Currently I have:

Code: Select all

objref sh
sh = new PlotShape()
sh.variable("max")
sh.scale(some number, other number)
This brings up a ShapePlot with the appropriate variable (max). However, the color doesn't come on unless I right click on the figure and choose 'Shape Plot'. Is there a command that I can add to the .hoc code that will add the color automatically?

Thanks again!
Corinne
Posts: 38
Joined: Wed Feb 09, 2011 7:13 pm

Re: Jaffe & Carnevale 1999 code

Post by Corinne »

Also I would like to put the maximum epsp amplitudes in a vector so that I can take the .max and .min of the vector in order to automatically set the scale of my ShapePlot. I think I need something like the following but I can't quite get it right:

Code: Select all

//put the max amplitute epsp of every segment and section in a vector
objref ampvec
ampvec = new Vector()
forall for (x,0) ampvec.append(vepsp_max(x))

//set the scale of the plot
upperV=ampvec.max()
lowerV=ampvec.min()

//make plot
objref sh
sh = new PlotShape()
sh.variable("max")
sh.scale(lowerV, upperV)
Getting the values of the epsp in the vector doesn't quite work. Advice would be appreciated. Thanks again!
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Jaffe & Carnevale 1999 code

Post by ted »

Corinne wrote:However, the color doesn't come on unless I right click on the figure and choose 'Shape Plot'. Is there a command that I can add to the .hoc code that will add the color automatically?
Good question. Assuming that foo is the name of an objref that points to the PlotShape instance in question
foo.exec_menu("Shape Plot")
Read about the exec_menu() method in the documentation of the Graph class.
Post Reply