sda.plot.fplot#
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
- sda.io.load.loadany() function to deal with any data in the lab
- 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 Scriptsfplot.bat for Windows, or directly from the console with “fplot”.
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:
normalize graphs- param #TODO -i:
- type #TODO -i:
interactive:consoletomodify graphs,drag & drop new graphs,etc.
Attributes#
Functions#
Module Contents#
- sda.plot.fplot.FplotInterface#
- sda.plot.fplot.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
- sda.plot.fplot.init_script = Multiline-String#
Show Value
"""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( )"""
- sda.plot.fplot.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.
Examples
This function is called directly from the command line with the
fplotcommand:fplot [file1] [file2]
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
- sda.plot.fplot.args#