sda.plot.fplot ============== .. py:module:: sda.plot.fplot .. autoapi-nested-parse:: Created on Thu Nov 19 12:24:17 2015. @author: Erwan fplot, formerly "fastplot", is a tool to quickly plot data. It relies uppon: - A main window where to drag & drop a datafile - :py:func:`sda.io.load.loadany` function to deal with any data in the lab - :py:class:`sda.plot.fplotanalyser.Analyser` to format the graph accordingly (showing units, correct scales, etc.). . - An embedded Qtconsole to interact with the data Fplot is better started from an external script such as Scripts\fplot.bat for Windows, or directly from the console with "fplot". .. rubric:: Examples plot a file:: fplot [file] starts the fplot GUI. Drag&drop files in:: #TODO fplot -i starts the fplot GUI & plot file:: #TODO fplot -i [file] plot two RADIS Spectrum objects, compare them: fplot [spectrumfile1.spec] [spectrumfile2.spec] :param -n: :type -n: :py:class:`normalize graphs` :param #TODO -i: :type #TODO -i: :py:class:`interactive`: :py:class:`console` to :py:class:`modify graphs`, :py:class:`drag & drop new graphs`, :py:class:`etc.` Attributes ---------- .. autoapisummary:: sda.plot.fplot.FplotInterface sda.plot.fplot.init_script sda.plot.fplot.args Functions --------- .. autoapisummary:: sda.plot.fplot.put_ipy sda.plot.fplot.main Module Contents --------------- .. py:data:: FplotInterface .. py:function:: put_ipy(parent) Put an iPython console in the window, connected with the same Kernel. Original code: mdurant http://stackoverflow.com/questions/26666583/embedding-ipython-qtconsole-and-passing-objects .. py:data:: init_script :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """from pylab import * ion() def data(): "use (x,y)=data()[0] to get data from first line" return [[l.get_xdata(),l.get_ydata()] for l in gca().get_lines()] print( ) print(' ***') print(' pylab imported') print(' use (x,y)=data()[0] to get data from first line') print(' ***') print( )""" .. raw:: html
.. py:function:: main(args=None, verbose=False, norm=False, console=True) Display the interface. If files is None: will only display the drag & drop windows. If it's a file, will plot the file. .. rubric:: Examples This function is called directly from the command line with the ``fplot`` command:: fplot [file1] [file2] .. rubric:: Notes Features:: - #TODO If using ``'-i'``, will start interactive mode: display a drag & drop windows to add new files, and a Python console to modifiy existing plots with Matplotlib commands - if it's a folder, will plot all files in the folder .. py:data:: args