Antonino Ingargiola edited Concepts.tex  over 9 years ago

Commit id: 5e4b3eeade0f3c5121f6a0a28a80f90ff9c34cb2

deletions | additions      

       

\subsection{Plotting "Data"}  FRETBursts uses matplotlib~\cite{2096e2a4-8f50-4519-bfb3-f796da201630} to  provide a wide range of built-in \href{http://fretbursts.readthedocs.org/en/latest/plots.html}{built-in  plot functions functions}  for \verb|Data| objects. The plot syntax is the same both for single and multi-spot measurements. Almost all the plot commands are called through the wrapper function \verb|dplot|, for example to plot a timetrace of the photon data we type: \begin{verbatim}  dplot(d, timetrace) 

\verb|dplot| creates one subplot for each spot and calls \verb|timetrace| for  each channel.  All the built-in plot functions that can be passed to \verb|dplot| are defined in the \verb|burst_plot| module. \href{http://fretbursts.readthedocs.org/en/latest/plots.html}{\texttt{burst_plot} module}.  When importing fretbursts all the plot functions are also imported. To make easy to find plot function through auto-completion,all  the plot functions function  names start with a prefix indicating the plot type. Theplot names  prefixes are: \verb|timetrace| for binned timetraces of photon data, \verb|ratetrace| for rates of photons as a function of time (non  binnned), \verb|hist| for functions plotting histograms and \verb|scatter| for  scatter plots.  Additional plots can be manually easily  created directly with matplotlib. Usually plots are displayed inline in the notebook. However a few plot functions  such as \verb|timetrace| and \verb|hist2d_alex| have interactive features that can be enabled when using the QT4 backend that open opens  the plot in an external window. It is possible to switch backend from inline to QT and vice versa using  the ipython commands \verb|%matplotlib qt|  and \verb|%matplotlib inline|. For example, after switching to the QT4 backend  %the the  following commads: \begin{verbatim}  dplot(d, timetrace, scroll=True)