#! /bin/bash # Last edited on 2021-01-11 07:51:21 by jstolfi # Reads the trace of a set of consecutive neurons in an elem_level simulation. # Plots the activity {rho[t]} (average of {X[t]} over those neurons) # The vertical axis is in mV. cmd="$0"; cmd="${cmd##*/}" show=$1; shift # 1 to display the plot fname="$1"; shift # Trace file name ineLo="$1"; shift # Index of first neuron. ineHi="$1"; shift # Index of last neuron. tLo="$1"; shift; # First time to plot. tHi="$1"; shift; # Last time to plot. rhoMax="$1"; shift # Max activity to plot, fractional in [0 _ 1]. # END COMMAND LINE PARSING # ---------------------------------------------------------------------- # Prefix for temporary file names tmp="/tmp/$$" hPix=1800 hTics=( `nmsim_choose_plot_tics.gawk -v vLo=${tLo} -v vHi=${tHi} -v nPix=${hPix}` ) # Decide the title and plotting range: if [[ ${ineLo} -lt ${ineHi} ]]; then title="Neurons ${ineLo} .. ${ineHi} - Activity rho[t]" vPix=600 vTics=( -0.04 1.04 0.1 2 ) else title="Neuron ${ineLo} - Firings X[t]" vPix=400 vTics=( -0.08 1.08 0.2 2 ) fi echo "{${cmd}}: title = \"${title}\"" 1>&2 which="rho" tfile="${tmp}_${which}.png" export GDFONTPATH="." gnuplot <