Skip to content
Snippets Groups Projects
Unverified Commit 6e1d0482 authored by Brent Huisman's avatar Brent Huisman Committed by GitHub
Browse files

Docs: minor plot tweaking (#1184)

parent e2bcc71e
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@ Single compartment cell with HH dynamics
The most trivial representation of a cell in Arbor is to model the entire cell as a
cylinder. The following example shows the steps required to construct a model of a
cylindrical cell with radius 3 μm, Hodgkin–Huxley dynamics and a current clamp stimulus,
then run the model for 100 ms.
then run the model for 30 ms.
The first step is to construct the cell. In Arbor, the abstract representation used to
define a cell with branching "cable" morphology is a ``cable_cell``, which holds a
......@@ -107,8 +107,8 @@ and provides an interface for recording potentials and running the simulation.
# (5) Attach voltage probe sampling at 10 kHz (every 0.1 ms).
m.probe('voltage', '"center"', frequency=10000)
# (6) Run simulation for 100 ms of simulated activity.
m.run(tfinal=100)
# (6) Run simulation for 30 ms of simulated activity.
m.run(tfinal=30)
Step **(4)** instantiates the :class:`arbor.single_cell_model<arbor.single_cell_model>`
with our single-compartment cell.
......@@ -118,7 +118,7 @@ is used to record variables from the model. Three pieces of information are
provided: the type of quantity we want probed (voltage), the location where we want to
probe ('center'), and the frequency at which we want to sample (10kHz).
Finally, step **(6)** starts the actual simulation for a duration of 100 ms.
Finally, step **(6)** starts the actual simulation for a duration of 30 ms.
Results
----------------------------------------------------
......@@ -139,6 +139,7 @@ spike_detector and a voltage probe. Let's see what they have produced!
# (8) Plot the recorded voltages over time.
import pandas, seaborn # You may have to pip install these.
seaborn.set_theme() # Apply some styling to the plot
df = pandas.DataFrame({'t/ms': m.traces[0].time, 'U/mV': m.traces[0].value})
seaborn.relplot(data=df, kind="line", x="t/ms", y="U/mV").savefig('single_cell_model_result.svg')
......
......@@ -2,7 +2,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Created with matplotlib (https://matplotlib.org/) -->
<svg height="366.07625pt" version="1.1" viewBox="0 0 366.432812 366.07625" width="366.432812pt" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg height="363.939687pt" version="1.1" viewBox="0 0 364.088906 363.939687" width="364.088906pt" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<style type="text/css">
*{stroke-linecap:butt;stroke-linejoin:round;}
......@@ -10,33 +10,28 @@
</defs>
<g id="figure_1">
<g id="patch_1">
<path d="M 0 366.07625
L 366.432812 366.07625
L 366.432812 0
<path d="M 0 363.939687
L 364.088906 363.939687
L 364.088906 0
L 0 0
z
" style="fill:#ffffff;"/>
</g>
<g id="axes_1">
<g id="patch_2">
<path d="M 48.982813 328.52
L 359.232812 328.52
L 359.232812 7.2
L 48.982813 7.2
<path d="M 55.528906 320.98
L 356.888906 320.98
L 356.888906 7.2
L 55.528906 7.2
z
" style="fill:#ffffff;"/>
" style="fill:#eaeaf2;"/>
</g>
<g id="matplotlib.axis_1">
<g id="xtick_1">
<g id="line2d_1">
<defs>
<path d="M 0 0
L 0 3.5
" id="m49bb8fd34e" style="stroke:#000000;stroke-width:0.8;"/>
</defs>
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="63.085085" xlink:href="#m49bb8fd34e" y="328.52"/>
</g>
<path clip-path="url(#p44c0473347)" d="M 69.227088 320.98
L 69.227088 7.2
" style="fill:none;stroke:#ffffff;stroke-linecap:round;"/>
</g>
<g id="text_1">
<!-- 0 -->
......@@ -63,216 +58,196 @@ Q 19.53125 74.21875 31.78125 74.21875
z
" id="DejaVuSans-48"/>
</defs>
<g transform="translate(59.903835 343.118437)scale(0.1 -0.1)">
<g style="fill:#262626;" transform="translate(65.727713 338.838281)scale(0.11 -0.11)">
<use xlink:href="#DejaVuSans-48"/>
</g>
</g>
</g>
<g id="xtick_2">
<g id="line2d_2">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="119.564776" xlink:href="#m49bb8fd34e" y="328.52"/>
</g>
<path clip-path="url(#p44c0473347)" d="M 115.040405 320.98
L 115.040405 7.2
" style="fill:none;stroke:#ffffff;stroke-linecap:round;"/>
</g>
<g id="text_2">
<!-- 20 -->
<!-- 5 -->
<defs>
<path d="M 19.1875 8.296875
L 53.609375 8.296875
L 53.609375 0
L 7.328125 0
L 7.328125 8.296875
Q 12.9375 14.109375 22.625 23.890625
Q 32.328125 33.6875 34.8125 36.53125
Q 39.546875 41.84375 41.421875 45.53125
Q 43.3125 49.21875 43.3125 52.78125
Q 43.3125 58.59375 39.234375 62.25
Q 35.15625 65.921875 28.609375 65.921875
Q 23.96875 65.921875 18.8125 64.3125
Q 13.671875 62.703125 7.8125 59.421875
L 7.8125 69.390625
Q 13.765625 71.78125 18.9375 73
Q 24.125 74.21875 28.421875 74.21875
Q 39.75 74.21875 46.484375 68.546875
Q 53.21875 62.890625 53.21875 53.421875
Q 53.21875 48.921875 51.53125 44.890625
Q 49.859375 40.875 45.40625 35.40625
Q 44.1875 33.984375 37.640625 27.21875
Q 31.109375 20.453125 19.1875 8.296875
<path d="M 10.796875 72.90625
L 49.515625 72.90625
L 49.515625 64.59375
L 19.828125 64.59375
L 19.828125 46.734375
Q 21.96875 47.46875 24.109375 47.828125
Q 26.265625 48.1875 28.421875 48.1875
Q 40.625 48.1875 47.75 41.5
Q 54.890625 34.8125 54.890625 23.390625
Q 54.890625 11.625 47.5625 5.09375
Q 40.234375 -1.421875 26.90625 -1.421875
Q 22.3125 -1.421875 17.546875 -0.640625
Q 12.796875 0.140625 7.71875 1.703125
L 7.71875 11.625
Q 12.109375 9.234375 16.796875 8.0625
Q 21.484375 6.890625 26.703125 6.890625
Q 35.15625 6.890625 40.078125 11.328125
Q 45.015625 15.765625 45.015625 23.390625
Q 45.015625 31 40.078125 35.4375
Q 35.15625 39.890625 26.703125 39.890625
Q 22.75 39.890625 18.8125 39.015625
Q 14.890625 38.140625 10.796875 36.28125
z
" id="DejaVuSans-50"/>
" id="DejaVuSans-53"/>
</defs>
<g transform="translate(113.202276 343.118437)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-50"/>
<use x="63.623047" xlink:href="#DejaVuSans-48"/>
<g style="fill:#262626;" transform="translate(111.54103 338.838281)scale(0.11 -0.11)">
<use xlink:href="#DejaVuSans-53"/>
</g>
</g>
</g>
<g id="xtick_3">
<g id="line2d_3">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="176.044466" xlink:href="#m49bb8fd34e" y="328.52"/>
</g>
<path clip-path="url(#p44c0473347)" d="M 160.853722 320.98
L 160.853722 7.2
" style="fill:none;stroke:#ffffff;stroke-linecap:round;"/>
</g>
<g id="text_3">
<!-- 40 -->
<!-- 10 -->
<defs>
<path d="M 37.796875 64.3125
L 12.890625 25.390625
L 37.796875 25.390625
z
M 35.203125 72.90625
L 47.609375 72.90625
L 47.609375 25.390625
L 58.015625 25.390625
L 58.015625 17.1875
L 47.609375 17.1875
L 47.609375 0
L 37.796875 0
L 37.796875 17.1875
L 4.890625 17.1875
L 4.890625 26.703125
<path d="M 12.40625 8.296875
L 28.515625 8.296875
L 28.515625 63.921875
L 10.984375 60.40625
L 10.984375 69.390625
L 28.421875 72.90625
L 38.28125 72.90625
L 38.28125 8.296875
L 54.390625 8.296875
L 54.390625 0
L 12.40625 0
z
" id="DejaVuSans-52"/>
" id="DejaVuSans-49"/>
</defs>
<g transform="translate(169.681966 343.118437)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-52"/>
<g style="fill:#262626;" transform="translate(153.854972 338.838281)scale(0.11 -0.11)">
<use xlink:href="#DejaVuSans-49"/>
<use x="63.623047" xlink:href="#DejaVuSans-48"/>
</g>
</g>
</g>
<g id="xtick_4">
<g id="line2d_4">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="232.524157" xlink:href="#m49bb8fd34e" y="328.52"/>
</g>
<path clip-path="url(#p44c0473347)" d="M 206.667039 320.98
L 206.667039 7.2
" style="fill:none;stroke:#ffffff;stroke-linecap:round;"/>
</g>
<g id="text_4">
<!-- 60 -->
<defs>
<path d="M 33.015625 40.375
Q 26.375 40.375 22.484375 35.828125
Q 18.609375 31.296875 18.609375 23.390625
Q 18.609375 15.53125 22.484375 10.953125
Q 26.375 6.390625 33.015625 6.390625
Q 39.65625 6.390625 43.53125 10.953125
Q 47.40625 15.53125 47.40625 23.390625
Q 47.40625 31.296875 43.53125 35.828125
Q 39.65625 40.375 33.015625 40.375
z
M 52.59375 71.296875
L 52.59375 62.3125
Q 48.875 64.0625 45.09375 64.984375
Q 41.3125 65.921875 37.59375 65.921875
Q 27.828125 65.921875 22.671875 59.328125
Q 17.53125 52.734375 16.796875 39.40625
Q 19.671875 43.65625 24.015625 45.921875
Q 28.375 48.1875 33.59375 48.1875
Q 44.578125 48.1875 50.953125 41.515625
Q 57.328125 34.859375 57.328125 23.390625
Q 57.328125 12.15625 50.6875 5.359375
Q 44.046875 -1.421875 33.015625 -1.421875
Q 20.359375 -1.421875 13.671875 8.265625
Q 6.984375 17.96875 6.984375 36.375
Q 6.984375 53.65625 15.1875 63.9375
Q 23.390625 74.21875 37.203125 74.21875
Q 40.921875 74.21875 44.703125 73.484375
Q 48.484375 72.75 52.59375 71.296875
z
" id="DejaVuSans-54"/>
</defs>
<g transform="translate(226.161657 343.118437)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-54"/>
<use x="63.623047" xlink:href="#DejaVuSans-48"/>
<!-- 15 -->
<g style="fill:#262626;" transform="translate(199.668289 338.838281)scale(0.11 -0.11)">
<use xlink:href="#DejaVuSans-49"/>
<use x="63.623047" xlink:href="#DejaVuSans-53"/>
</g>
</g>
</g>
<g id="xtick_5">
<g id="line2d_5">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="289.003847" xlink:href="#m49bb8fd34e" y="328.52"/>
</g>
<path clip-path="url(#p44c0473347)" d="M 252.480357 320.98
L 252.480357 7.2
" style="fill:none;stroke:#ffffff;stroke-linecap:round;"/>
</g>
<g id="text_5">
<!-- 80 -->
<!-- 20 -->
<defs>
<path d="M 31.78125 34.625
Q 24.75 34.625 20.71875 30.859375
Q 16.703125 27.09375 16.703125 20.515625
Q 16.703125 13.921875 20.71875 10.15625
Q 24.75 6.390625 31.78125 6.390625
Q 38.8125 6.390625 42.859375 10.171875
Q 46.921875 13.96875 46.921875 20.515625
Q 46.921875 27.09375 42.890625 30.859375
Q 38.875 34.625 31.78125 34.625
z
M 21.921875 38.8125
Q 15.578125 40.375 12.03125 44.71875
Q 8.5 49.078125 8.5 55.328125
Q 8.5 64.0625 14.71875 69.140625
Q 20.953125 74.21875 31.78125 74.21875
Q 42.671875 74.21875 48.875 69.140625
Q 55.078125 64.0625 55.078125 55.328125
Q 55.078125 49.078125 51.53125 44.71875
Q 48 40.375 41.703125 38.8125
Q 48.828125 37.15625 52.796875 32.3125
Q 56.78125 27.484375 56.78125 20.515625
Q 56.78125 9.90625 50.3125 4.234375
Q 43.84375 -1.421875 31.78125 -1.421875
Q 19.734375 -1.421875 13.25 4.234375
Q 6.78125 9.90625 6.78125 20.515625
Q 6.78125 27.484375 10.78125 32.3125
Q 14.796875 37.15625 21.921875 38.8125
z
M 18.3125 54.390625
Q 18.3125 48.734375 21.84375 45.5625
Q 25.390625 42.390625 31.78125 42.390625
Q 38.140625 42.390625 41.71875 45.5625
Q 45.3125 48.734375 45.3125 54.390625
Q 45.3125 60.0625 41.71875 63.234375
Q 38.140625 66.40625 31.78125 66.40625
Q 25.390625 66.40625 21.84375 63.234375
Q 18.3125 60.0625 18.3125 54.390625
<path d="M 19.1875 8.296875
L 53.609375 8.296875
L 53.609375 0
L 7.328125 0
L 7.328125 8.296875
Q 12.9375 14.109375 22.625 23.890625
Q 32.328125 33.6875 34.8125 36.53125
Q 39.546875 41.84375 41.421875 45.53125
Q 43.3125 49.21875 43.3125 52.78125
Q 43.3125 58.59375 39.234375 62.25
Q 35.15625 65.921875 28.609375 65.921875
Q 23.96875 65.921875 18.8125 64.3125
Q 13.671875 62.703125 7.8125 59.421875
L 7.8125 69.390625
Q 13.765625 71.78125 18.9375 73
Q 24.125 74.21875 28.421875 74.21875
Q 39.75 74.21875 46.484375 68.546875
Q 53.21875 62.890625 53.21875 53.421875
Q 53.21875 48.921875 51.53125 44.890625
Q 49.859375 40.875 45.40625 35.40625
Q 44.1875 33.984375 37.640625 27.21875
Q 31.109375 20.453125 19.1875 8.296875
z
" id="DejaVuSans-56"/>
" id="DejaVuSans-50"/>
</defs>
<g transform="translate(282.641347 343.118437)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-56"/>
<g style="fill:#262626;" transform="translate(245.481607 338.838281)scale(0.11 -0.11)">
<use xlink:href="#DejaVuSans-50"/>
<use x="63.623047" xlink:href="#DejaVuSans-48"/>
</g>
</g>
</g>
<g id="xtick_6">
<g id="line2d_6">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="345.483538" xlink:href="#m49bb8fd34e" y="328.52"/>
</g>
<path clip-path="url(#p44c0473347)" d="M 298.293674 320.98
L 298.293674 7.2
" style="fill:none;stroke:#ffffff;stroke-linecap:round;"/>
</g>
<g id="text_6">
<!-- 100 -->
<!-- 25 -->
<g style="fill:#262626;" transform="translate(291.294924 338.838281)scale(0.11 -0.11)">
<use xlink:href="#DejaVuSans-50"/>
<use x="63.623047" xlink:href="#DejaVuSans-53"/>
</g>
</g>
</g>
<g id="xtick_7">
<g id="line2d_7">
<path clip-path="url(#p44c0473347)" d="M 344.106991 320.98
L 344.106991 7.2
" style="fill:none;stroke:#ffffff;stroke-linecap:round;"/>
</g>
<g id="text_7">
<!-- 30 -->
<defs>
<path d="M 12.40625 8.296875
L 28.515625 8.296875
L 28.515625 63.921875
L 10.984375 60.40625
L 10.984375 69.390625
L 28.421875 72.90625
L 38.28125 72.90625
L 38.28125 8.296875
L 54.390625 8.296875
L 54.390625 0
L 12.40625 0
<path d="M 40.578125 39.3125
Q 47.65625 37.796875 51.625 33
Q 55.609375 28.21875 55.609375 21.1875
Q 55.609375 10.40625 48.1875 4.484375
Q 40.765625 -1.421875 27.09375 -1.421875
Q 22.515625 -1.421875 17.65625 -0.515625
Q 12.796875 0.390625 7.625 2.203125
L 7.625 11.71875
Q 11.71875 9.328125 16.59375 8.109375
Q 21.484375 6.890625 26.8125 6.890625
Q 36.078125 6.890625 40.9375 10.546875
Q 45.796875 14.203125 45.796875 21.1875
Q 45.796875 27.640625 41.28125 31.265625
Q 36.765625 34.90625 28.71875 34.90625
L 20.21875 34.90625
L 20.21875 43.015625
L 29.109375 43.015625
Q 36.375 43.015625 40.234375 45.921875
Q 44.09375 48.828125 44.09375 54.296875
Q 44.09375 59.90625 40.109375 62.90625
Q 36.140625 65.921875 28.71875 65.921875
Q 24.65625 65.921875 20.015625 65.03125
Q 15.375 64.15625 9.8125 62.3125
L 9.8125 71.09375
Q 15.4375 72.65625 20.34375 73.4375
Q 25.25 74.21875 29.59375 74.21875
Q 40.828125 74.21875 47.359375 69.109375
Q 53.90625 64.015625 53.90625 55.328125
Q 53.90625 49.265625 50.4375 45.09375
Q 46.96875 40.921875 40.578125 39.3125
z
" id="DejaVuSans-49"/>
" id="DejaVuSans-51"/>
</defs>
<g transform="translate(335.939788 343.118437)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-49"/>
<g style="fill:#262626;" transform="translate(337.108241 338.838281)scale(0.11 -0.11)">
<use xlink:href="#DejaVuSans-51"/>
<use x="63.623047" xlink:href="#DejaVuSans-48"/>
<use x="127.246094" xlink:href="#DejaVuSans-48"/>
</g>
</g>
</g>
<g id="text_7">
<g id="text_8">
<!-- t/ms -->
<defs>
<path d="M 18.3125 70.21875
......@@ -363,7 +338,7 @@ Q 40.578125 54.546875 44.28125 53.078125
z
" id="DejaVuSans-115"/>
</defs>
<g transform="translate(192.988281 356.796562)scale(0.1 -0.1)">
<g style="fill:#262626;" transform="translate(192.865469 354.244062)scale(0.12 -0.12)">
<use xlink:href="#DejaVuSans-116"/>
<use x="39.208984" xlink:href="#DejaVuSans-47"/>
<use x="72.900391" xlink:href="#DejaVuSans-109"/>
......@@ -373,17 +348,12 @@ z
</g>
<g id="matplotlib.axis_2">
<g id="ytick_1">
<g id="line2d_7">
<defs>
<path d="M 0 0
L -3.5 0
" id="m52d6302f9e" style="stroke:#000000;stroke-width:0.8;"/>
</defs>
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="48.982813" xlink:href="#m52d6302f9e" y="321.183759"/>
</g>
<g id="line2d_8">
<path clip-path="url(#p44c0473347)" d="M 55.528906 313.815883
L 356.888906 313.815883
" style="fill:none;stroke:#ffffff;stroke-linecap:round;"/>
</g>
<g id="text_8">
<g id="text_9">
<!-- −80 -->
<defs>
<path d="M 10.59375 35.5
......@@ -392,8 +362,47 @@ L 73.1875 27.203125
L 10.59375 27.203125
z
" id="DejaVuSans-8722"/>
<path d="M 31.78125 34.625
Q 24.75 34.625 20.71875 30.859375
Q 16.703125 27.09375 16.703125 20.515625
Q 16.703125 13.921875 20.71875 10.15625
Q 24.75 6.390625 31.78125 6.390625
Q 38.8125 6.390625 42.859375 10.171875
Q 46.921875 13.96875 46.921875 20.515625
Q 46.921875 27.09375 42.890625 30.859375
Q 38.875 34.625 31.78125 34.625
z
M 21.921875 38.8125
Q 15.578125 40.375 12.03125 44.71875
Q 8.5 49.078125 8.5 55.328125
Q 8.5 64.0625 14.71875 69.140625
Q 20.953125 74.21875 31.78125 74.21875
Q 42.671875 74.21875 48.875 69.140625
Q 55.078125 64.0625 55.078125 55.328125
Q 55.078125 49.078125 51.53125 44.71875
Q 48 40.375 41.703125 38.8125
Q 48.828125 37.15625 52.796875 32.3125
Q 56.78125 27.484375 56.78125 20.515625
Q 56.78125 9.90625 50.3125 4.234375
Q 43.84375 -1.421875 31.78125 -1.421875
Q 19.734375 -1.421875 13.25 4.234375
Q 6.78125 9.90625 6.78125 20.515625
Q 6.78125 27.484375 10.78125 32.3125
Q 14.796875 37.15625 21.921875 38.8125
z
M 18.3125 54.390625
Q 18.3125 48.734375 21.84375 45.5625
Q 25.390625 42.390625 31.78125 42.390625
Q 38.140625 42.390625 41.71875 45.5625
Q 45.3125 48.734375 45.3125 54.390625
Q 45.3125 60.0625 41.71875 63.234375
Q 38.140625 66.40625 31.78125 66.40625
Q 25.390625 66.40625 21.84375 63.234375
Q 18.3125 60.0625 18.3125 54.390625
z
" id="DejaVuSans-56"/>
</defs>
<g transform="translate(20.878125 324.982978)scale(0.1 -0.1)">
<g style="fill:#262626;" transform="translate(22.81375 317.995024)scale(0.11 -0.11)">
<use xlink:href="#DejaVuSans-8722"/>
<use x="83.789062" xlink:href="#DejaVuSans-56"/>
<use x="147.412109" xlink:href="#DejaVuSans-48"/>
......@@ -401,14 +410,46 @@ z
</g>
</g>
<g id="ytick_2">
<g id="line2d_8">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="48.982813" xlink:href="#m52d6302f9e" y="280.896601"/>
</g>
<g id="line2d_9">
<path clip-path="url(#p44c0473347)" d="M 55.528906 274.474106
L 356.888906 274.474106
" style="fill:none;stroke:#ffffff;stroke-linecap:round;"/>
</g>
<g id="text_9">
<g id="text_10">
<!-- −60 -->
<g transform="translate(20.878125 284.695819)scale(0.1 -0.1)">
<defs>
<path d="M 33.015625 40.375
Q 26.375 40.375 22.484375 35.828125
Q 18.609375 31.296875 18.609375 23.390625
Q 18.609375 15.53125 22.484375 10.953125
Q 26.375 6.390625 33.015625 6.390625
Q 39.65625 6.390625 43.53125 10.953125
Q 47.40625 15.53125 47.40625 23.390625
Q 47.40625 31.296875 43.53125 35.828125
Q 39.65625 40.375 33.015625 40.375
z
M 52.59375 71.296875
L 52.59375 62.3125
Q 48.875 64.0625 45.09375 64.984375
Q 41.3125 65.921875 37.59375 65.921875
Q 27.828125 65.921875 22.671875 59.328125
Q 17.53125 52.734375 16.796875 39.40625
Q 19.671875 43.65625 24.015625 45.921875
Q 28.375 48.1875 33.59375 48.1875
Q 44.578125 48.1875 50.953125 41.515625
Q 57.328125 34.859375 57.328125 23.390625
Q 57.328125 12.15625 50.6875 5.359375
Q 44.046875 -1.421875 33.015625 -1.421875
Q 20.359375 -1.421875 13.671875 8.265625
Q 6.984375 17.96875 6.984375 36.375
Q 6.984375 53.65625 15.1875 63.9375
Q 23.390625 74.21875 37.203125 74.21875
Q 40.921875 74.21875 44.703125 73.484375
Q 48.484375 72.75 52.59375 71.296875
z
" id="DejaVuSans-54"/>
</defs>
<g style="fill:#262626;" transform="translate(22.81375 278.653246)scale(0.11 -0.11)">
<use xlink:href="#DejaVuSans-8722"/>
<use x="83.789062" xlink:href="#DejaVuSans-54"/>
<use x="147.412109" xlink:href="#DejaVuSans-48"/>
......@@ -416,14 +457,33 @@ z
</g>
</g>
<g id="ytick_3">
<g id="line2d_9">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="48.982813" xlink:href="#m52d6302f9e" y="240.609442"/>
</g>
<g id="line2d_10">
<path clip-path="url(#p44c0473347)" d="M 55.528906 235.132328
L 356.888906 235.132328
" style="fill:none;stroke:#ffffff;stroke-linecap:round;"/>
</g>
<g id="text_10">
<g id="text_11">
<!-- −40 -->
<g transform="translate(20.878125 244.408661)scale(0.1 -0.1)">
<defs>
<path d="M 37.796875 64.3125
L 12.890625 25.390625
L 37.796875 25.390625
z
M 35.203125 72.90625
L 47.609375 72.90625
L 47.609375 25.390625
L 58.015625 25.390625
L 58.015625 17.1875
L 47.609375 17.1875
L 47.609375 0
L 37.796875 0
L 37.796875 17.1875
L 4.890625 17.1875
L 4.890625 26.703125
z
" id="DejaVuSans-52"/>
</defs>
<g style="fill:#262626;" transform="translate(22.81375 239.311469)scale(0.11 -0.11)">
<use xlink:href="#DejaVuSans-8722"/>
<use x="83.789062" xlink:href="#DejaVuSans-52"/>
<use x="147.412109" xlink:href="#DejaVuSans-48"/>
......@@ -431,14 +491,14 @@ z
</g>
</g>
<g id="ytick_4">
<g id="line2d_10">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="48.982813" xlink:href="#m52d6302f9e" y="200.322284"/>
</g>
<g id="line2d_11">
<path clip-path="url(#p44c0473347)" d="M 55.528906 195.790551
L 356.888906 195.790551
" style="fill:none;stroke:#ffffff;stroke-linecap:round;"/>
</g>
<g id="text_11">
<g id="text_12">
<!-- −20 -->
<g transform="translate(20.878125 204.121503)scale(0.1 -0.1)">
<g style="fill:#262626;" transform="translate(22.81375 199.969691)scale(0.11 -0.11)">
<use xlink:href="#DejaVuSans-8722"/>
<use x="83.789062" xlink:href="#DejaVuSans-50"/>
<use x="147.412109" xlink:href="#DejaVuSans-48"/>
......@@ -446,61 +506,61 @@ z
</g>
</g>
<g id="ytick_5">
<g id="line2d_11">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="48.982813" xlink:href="#m52d6302f9e" y="160.035126"/>
</g>
<g id="line2d_12">
<path clip-path="url(#p44c0473347)" d="M 55.528906 156.448773
L 356.888906 156.448773
" style="fill:none;stroke:#ffffff;stroke-linecap:round;"/>
</g>
<g id="text_12">
<g id="text_13">
<!-- 0 -->
<g transform="translate(35.620312 163.834345)scale(0.1 -0.1)">
<g style="fill:#262626;" transform="translate(39.030156 160.627914)scale(0.11 -0.11)">
<use xlink:href="#DejaVuSans-48"/>
</g>
</g>
</g>
<g id="ytick_6">
<g id="line2d_12">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="48.982813" xlink:href="#m52d6302f9e" y="119.747968"/>
</g>
<g id="line2d_13">
<path clip-path="url(#p44c0473347)" d="M 55.528906 117.106996
L 356.888906 117.106996
" style="fill:none;stroke:#ffffff;stroke-linecap:round;"/>
</g>
<g id="text_13">
<g id="text_14">
<!-- 20 -->
<g transform="translate(29.257812 123.547187)scale(0.1 -0.1)">
<g style="fill:#262626;" transform="translate(32.031406 121.286136)scale(0.11 -0.11)">
<use xlink:href="#DejaVuSans-50"/>
<use x="63.623047" xlink:href="#DejaVuSans-48"/>
</g>
</g>
</g>
<g id="ytick_7">
<g id="line2d_13">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="48.982813" xlink:href="#m52d6302f9e" y="79.46081"/>
</g>
<g id="line2d_14">
<path clip-path="url(#p44c0473347)" d="M 55.528906 77.765218
L 356.888906 77.765218
" style="fill:none;stroke:#ffffff;stroke-linecap:round;"/>
</g>
<g id="text_14">
<g id="text_15">
<!-- 40 -->
<g transform="translate(29.257812 83.260028)scale(0.1 -0.1)">
<g style="fill:#262626;" transform="translate(32.031406 81.944359)scale(0.11 -0.11)">
<use xlink:href="#DejaVuSans-52"/>
<use x="63.623047" xlink:href="#DejaVuSans-48"/>
</g>
</g>
</g>
<g id="ytick_8">
<g id="line2d_14">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="48.982813" xlink:href="#m52d6302f9e" y="39.173651"/>
</g>
<g id="line2d_15">
<path clip-path="url(#p44c0473347)" d="M 55.528906 38.423441
L 356.888906 38.423441
" style="fill:none;stroke:#ffffff;stroke-linecap:round;"/>
</g>
<g id="text_15">
<g id="text_16">
<!-- 60 -->
<g transform="translate(29.257812 42.97287)scale(0.1 -0.1)">
<g style="fill:#262626;" transform="translate(32.031406 42.602581)scale(0.11 -0.11)">
<use xlink:href="#DejaVuSans-54"/>
<use x="63.623047" xlink:href="#DejaVuSans-48"/>
</g>
</g>
</g>
<g id="text_16">
<g id="text_17">
<!-- U/mV -->
<defs>
<path d="M 8.6875 72.90625
......@@ -529,7 +589,7 @@ L 39.796875 0
z
" id="DejaVuSans-86"/>
</defs>
<g transform="translate(14.798438 181.494375)rotate(-90)scale(0.1 -0.1)">
<g style="fill:#262626;" transform="translate(16.318125 180.45125)rotate(-90)scale(0.12 -0.12)">
<use xlink:href="#DejaVuSans-85"/>
<use x="73.193359" xlink:href="#DejaVuSans-47"/>
<use x="106.884766" xlink:href="#DejaVuSans-109"/>
......@@ -537,78 +597,83 @@ z
</g>
</g>
</g>
<g id="line2d_15">
<path clip-path="url(#pea632d05c8)" d="M 63.085085 240.609442
L 63.367484 268.853158
L 63.932281 295.739397
L 64.426478 306.580671
L 64.708876 309.451131
L 64.991275 310.992518
L 65.273673 311.794635
L 65.556072 312.195492
L 65.83847 312.376785
L 66.473867 312.412842
L 67.60346 312.053077
L 69.58025 311.098473
L 71.839437 309.759731
L 74.381023 307.999988
L 77.699205 305.415768
L 86.171159 298.667669
L 89.277542 296.531845
L 91.254331 295.321216
L 92.101526 21.805455
L 92.383925 37.118805
L 96.337503 156.820674
L 96.9023 169.789614
L 97.184698 217.926161
L 97.749495 250.100895
L 98.879089 303.501927
L 99.161488 309.920879
L 99.443886 312.611457
L 99.726284 313.556795
L 100.008683 313.849482
L 100.57348 313.899438
L 101.985472 313.588824
L 104.24466 312.889842
L 106.503847 311.968071
L 108.763035 310.807197
L 111.304621 309.2223
L 114.128606 307.170475
L 118.152783 303.929575
L 124.083151 299.173071
L 127.471932 296.762489
L 130.295917 295.004761
L 133.119901 293.497215
L 135.943886 292.248918
L 138.485472 291.351521
L 141.027058 290.670668
L 143.568644 290.205351
L 146.392629 289.929787
L 149.216613 289.878824
L 152.605395 290.040577
L 168.13731 291.106575
L 174.632474 291.099525
L 197.789147 290.878751
L 249.468064 290.915211
L 345.13054 290.916218
L 345.13054 290.916218
" style="fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;"/>
<g id="line2d_16">
<path clip-path="url(#p44c0473347)" d="M 69.227088 235.132328
L 70.143354 262.713205
L 71.059621 278.343474
L 71.975887 288.96866
L 72.663087 294.610628
L 73.579353 299.555466
L 74.49562 302.358507
L 75.411886 303.863745
L 76.328152 304.647116
L 77.244419 305.038508
L 78.160685 305.21549
L 80.222284 305.250747
L 83.88735 304.899435
L 90.301214 303.967222
L 97.631345 302.660027
L 105.877742 300.941413
L 115.727605 298.640724
L 144.131862 291.828172
L 153.294525 289.920866
L 160.624656 288.560221
L 161.540922 187.364307
L 162.457188 59.752206
L 163.373455 21.462727
L 164.289721 36.416786
L 165.205987 44.934375
L 167.03852 59.028719
L 168.871053 76.093999
L 173.452385 122.289103
L 175.284917 138.7316
L 177.11745 153.309743
L 178.949983 165.97436
L 179.866249 212.981385
L 180.782515 231.901548
L 182.615048 257.252228
L 184.447581 285.413153
L 185.363847 296.548945
L 186.280113 302.817378
L 187.19638 305.444683
L 188.112646 306.36786
L 189.028912 306.65373
L 190.861445 306.702401
L 195.442777 306.399218
L 202.772907 305.71657
L 210.103038 304.81647
L 217.433169 303.682728
L 224.7633 302.320362
L 233.009697 300.551758
L 243.317693 298.09974
L 268.056884 292.114569
L 278.135814 289.967592
L 287.298478 288.251161
L 296.461141 286.778969
L 304.707538 285.670289
L 312.953935 284.770563
L 321.200332 284.082269
L 329.446729 283.604744
L 338.609393 283.311685
L 343.190724 283.251399
L 343.190724 283.251399
" style="fill:none;stroke:#4c72b0;stroke-linecap:round;stroke-width:1.5;"/>
</g>
<g id="patch_3">
<path d="M 48.982813 328.52
L 48.982813 7.2
" style="fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;"/>
<path d="M 55.528906 320.98
L 55.528906 7.2
" style="fill:none;stroke:#ffffff;stroke-linecap:square;stroke-linejoin:miter;stroke-width:1.25;"/>
</g>
<g id="patch_4">
<path d="M 48.982813 328.52
L 359.232812 328.52
" style="fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;"/>
<path d="M 55.528906 320.98
L 356.888906 320.98
" style="fill:none;stroke:#ffffff;stroke-linecap:square;stroke-linejoin:miter;stroke-width:1.25;"/>
</g>
</g>
</g>
<defs>
<clipPath id="pea632d05c8">
<rect height="321.32" width="310.25" x="48.982813" y="7.2"/>
<clipPath id="p44c0473347">
<rect height="313.78" width="301.36" x="55.528906" y="7.2"/>
</clipPath>
</defs>
</svg>
......@@ -21,8 +21,8 @@ m = arbor.single_cell_model(cell)
# (5) Attach voltage probe sampling at 10 kHz (every 0.1 ms).
m.probe('voltage', '"center"', frequency=10000)
# (6) Run simulation for 100 ms of simulated activity.
m.run(tfinal=100)
# (6) Run simulation for 30 ms of simulated activity.
m.run(tfinal=30)
# (7) Print spike times, if any.
if len(m.spikes)>0:
......@@ -34,6 +34,7 @@ else:
# (8) Plot the recorded voltages over time.
import pandas, seaborn # You may have to pip install these.
seaborn.set_theme() # Apply some styling to the plot
df = pandas.DataFrame({'t/ms': m.traces[0].time, 'U/mV': m.traces[0].value})
seaborn.relplot(data=df, kind="line", x="t/ms", y="U/mV").savefig('single_cell_model_result.svg')
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment