From 9751a2c895639835509a513ed238981ca24983aa Mon Sep 17 00:00:00 2001 From: Sebastian Schmitt <sebastian.schmitt@kip.uni-heidelberg.de> Date: Tue, 10 Nov 2020 09:49:04 +0100 Subject: [PATCH] Speed up plotting (#1210) Speed up plotting in seaborn.relplot by disabling calculation of confidence intervals --- doc/tutorial/single_cell_model.rst | 2 +- python/example/network_ring.py | 2 +- python/example/single_cell_model.py | 2 +- python/example/single_cell_multi_branch.py | 2 +- python/example/single_cell_swc.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/tutorial/single_cell_model.rst b/doc/tutorial/single_cell_model.rst index f0f8c56b..388c1254 100644 --- a/doc/tutorial/single_cell_model.rst +++ b/doc/tutorial/single_cell_model.rst @@ -142,7 +142,7 @@ results! Let's take a look at what the spike detector and a voltage probes from 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') + seaborn.relplot(data=df, kind="line", x="t/ms", y="U/mV",ci=None).savefig('single_cell_model_result.svg') Step **(7)** accesses :meth:`arbor.single_cell_model.spikes<arbor.single_cell_model.spikes>` to print the spike times. A single spike should be generated at around the same time the stimulus diff --git a/python/example/network_ring.py b/python/example/network_ring.py index e486c624..49fe5a69 100644 --- a/python/example/network_ring.py +++ b/python/example/network_ring.py @@ -152,4 +152,4 @@ for gid in range(ncells): df_list.append(pandas.DataFrame({'t/ms': times, 'U/mV': volts, 'Cell': f"cell {gid}"})) df = pandas.concat(df_list) -seaborn.relplot(data=df, kind="line", x="t/ms", y="U/mV",hue="Cell").savefig('network_ring_result.svg') +seaborn.relplot(data=df, kind="line", x="t/ms", y="U/mV",hue="Cell",ci=None).savefig('network_ring_result.svg') diff --git a/python/example/single_cell_model.py b/python/example/single_cell_model.py index 76345417..d3f6bf9c 100644 --- a/python/example/single_cell_model.py +++ b/python/example/single_cell_model.py @@ -37,7 +37,7 @@ else: print("Plotting results ...") 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') +seaborn.relplot(data=df, kind="line", x="t/ms", y="U/mV",ci=None).savefig('single_cell_model_result.svg') # (9) Optionally, you can store your results for later processing. df.to_csv('single_cell_model_result.csv', float_format='%g') diff --git a/python/example/single_cell_multi_branch.py b/python/example/single_cell_multi_branch.py index 6bc6c013..ce14a6bb 100644 --- a/python/example/single_cell_multi_branch.py +++ b/python/example/single_cell_multi_branch.py @@ -107,4 +107,4 @@ df = pandas.DataFrame() for t in m.traces: df=df.append(pandas.DataFrame({'t/ms': t.time, 'U/mV': t.value, 'Location': t.location, "Variable": t.variable}) ) -seaborn.relplot(data=df, kind="line", x="t/ms", y="U/mV",hue="Location",col="Variable").savefig('single_cell_multi_branch_result.svg') +seaborn.relplot(data=df, kind="line", x="t/ms", y="U/mV",hue="Location",col="Variable",ci=None).savefig('single_cell_multi_branch_result.svg') diff --git a/python/example/single_cell_swc.py b/python/example/single_cell_swc.py index 5136218b..fe72c3fa 100644 --- a/python/example/single_cell_swc.py +++ b/python/example/single_cell_swc.py @@ -87,4 +87,4 @@ for t in m.traces: df = pandas.concat(df_list) -seaborn.relplot(data=df, kind="line", x="t/ms", y="U/mV",hue="Location",col="Variable").savefig('single_cell_swc.svg') +seaborn.relplot(data=df, kind="line", x="t/ms", y="U/mV",hue="Location",col="Variable",ci=None).savefig('single_cell_swc.svg') -- GitLab