diff --git a/plotting/code/automatic_plot.m b/plotting/code/automatic_plot.m new file mode 100644 index 0000000..8056c64 --- /dev/null +++ b/plotting/code/automatic_plot.m @@ -0,0 +1,30 @@ +clear all +close all + +load('pyramidal_response.mat') +threshold = 20; % mV + +figure() +hold on +plot(time, neuronal_data, 'color', [0.2 0.5 0.7], 'linewidth', 1., ... + 'displayname', 'membrane voltage') +plot(spikes, ones(size(spikes)) .* threshold, 'ro', 'markersize', 5, ... + 'displayname', 'spike times') +line([time(1) time(end)], [threshold threshold], 'linestyle', '--', ... + 'linewidth', 0.75, 'color', [0.5 0.5 0.9], 'displayname', 'threshold') + +xlabel('time [s]', 'fontname', 'Times', 'fontsize', 11) +ylabel('potential [mV]', 'fontname', 'Times', 'fontsize', 11) +title('ELL pyramidal neuron', 'fontname', 'Times', 'fontsize', 12) +ylim([0 35]) +xlim([0 2.25]) +box('off') +l = legend(gca,'show'); +set(l,'Location','northwest', 'Fontsize', 7, 'LineWidth', 1.); +set(gca, 'XMinorTick','on','yMinorTick','on') +set(gca, 'TickDir','out', 'linewidth', 1.5, 'fontname', 'Times', ... + 'fontsize', 11) +set(gcf, 'PaperUnits', 'centimeters', 'PaperSize', [15 7.5]); +set(gcf, 'PaperPosition',[0.0 0.0 15, 7.5], 'Color', 'white') + +saveas(gcf, [pwd '/../lecture/images/spike_detection.pdf'], 'pdf') \ No newline at end of file diff --git a/plotting/code/pyramidal_response.mat b/plotting/code/pyramidal_response.mat new file mode 100644 index 0000000..85b76f0 Binary files /dev/null and b/plotting/code/pyramidal_response.mat differ diff --git a/plotting/lecture/images/spike_detection.pdf b/plotting/lecture/images/spike_detection.pdf index 8b682b0..96f40d0 100644 Binary files a/plotting/lecture/images/spike_detection.pdf and b/plotting/lecture/images/spike_detection.pdf differ diff --git a/plotting/lecture/plotting.tex b/plotting/lecture/plotting.tex index caaf9fc..c8e9a09 100644 --- a/plotting/lecture/plotting.tex +++ b/plotting/lecture/plotting.tex @@ -385,27 +385,10 @@ erstes Argument wieder ein Handle auf die Figure erwartet. Das zweite Argument ist der Dateiname, und zuletzt muss das gew\"unschte Format (Box \ref{graphicsformatbox}) angegeben werden. -\begin{lstlisting}[caption={Skript zur Erstellung des Plots in \figref{spikedetectionfig}.}, label=niceplotlisting] -figure() -set(gcf, 'PaperUnits', 'centimeters', 'PaperSize', [11.7 9.0]); -set(gcf, 'PaperPosition',[0.0 0.0 11.7 9.0], 'Color', 'white') -hold on -plot(time, neuronal_data, 'color', [ 0.2 0.5 0.7], 'linewidth', 1.) -plot(spike_times, ones(size(spike_times))*threshold, 'ro', 'markersize', 4) -line([time(1) time(end)], [threshold threshold], 'linestyle', '--', - 'linewidth', 0.75, 'color', [0.9 0.9 0.9]) -ylim([0 35]) -xlim([0 2.25]) -box('off') -xlabel('time [s]', 'fontname', 'MyriadPro-Regular', 'fontsize', 10) -ylabel('potential [mV]', 'fontname', 'MyriadPro-Regular', 'fontsize', 10) -title('pyramidal cell', 'fontname', 'MyriadPro-Regular', 'fontsize', 12) -set(gca, 'TickDir','out', 'linewidth', 1.5, 'fontname', 'MyriadPro-Regular') -saveas(gcf, 'spike_detection.pdf', 'pdf') -\end{lstlisting} +\lstinputlisting[caption={Skript zur Erstellung des Plots in \figref{spikedetectionfig}.}, label=niceplotlisting]{automatic_plot.m} \begin{figure} - \includegraphics[width=0.5\columnwidth]{spike_detection} + \includegraphics{spike_detection} \titlecaption{Automatisch erstellter Plot.}{Dieser Plot wurde vollst\"andig mit dem Skript in Listing \ref{niceplotlisting} erstellt und gespeichert.}\label{spikedetectionfig} diff --git a/programming/lecture/scripts_functions-slides.tex b/programming/lecture/scripts_functions-slides.tex index f7ad6a8..e69b511 100644 --- a/programming/lecture/scripts_functions-slides.tex +++ b/programming/lecture/scripts_functions-slides.tex @@ -563,7 +563,7 @@ legend('show') \begin{frame}[fragile] \frametitle{Skripte und Funktionen} \framesubtitle{Programmierstil} - In verschiednen Sprachen verschiedene Konventionen. In MATLAB ... + In verschiedenen Sprachen verschiedene Konventionen. In MATLAB ... \begin{itemize} \item Funktionen, Skripte: Kleinbuchstaben, Abk\"urzungen. (z.B. \verb+xcorr+, \verb+repmat+) \item Konvertierungen immer mit format2format (z.B. \verb+num2str+)