Plotting results
Plotting Matrices
It is possible to plot matrices using the fault analyzer. This only works if the result is a matrix (created via the carto module of the analyzer for instance).
To do so, the only thing to do is to use the plot
command with the index of the manip, the index of the result in this manip to plot and the style.
plot $MANIP_INDEX $RESULT_INDEX $STYLE
For instance:
plot 1 5 matrix
It is also possible to plot a matrix as a scatter:
plot 1 5 matrixscatter
Using matrix scatter, only the position with at least one fault will be plotted.
It is also possible to plot multiple matrices on the same scatter plot by giving the indexes of all the matrices to plot:
# Tested with experiment bcm2711b0_orrR5_iv5_laser_20x_4v_20ns_carto_core_20200211
plot 4 14,15 multimatrixscatterbin
Plotting several matrices on the same scatter plot removes the information of the number of faults per position as the different matrices will be plotted with different colors.
Using styles
For using a specific style, you can simply name it instead of the classic style. For instance:
plot 1 5 bcm2711b0_layout
Pre-built matrice styles
Various styles are already implemented for plotting matrices, they are mainly designed for matching with surface components.
They are defined in the plot/plot_styles.py
file. A style is a dictionary containing the rules for plotting the result, they are based on the Plotter Python package.
The styles suitable for plotting a matrice must have the type
entry set to either PlotterType.MATRIX
, PlotterType.MATRIXSCATTER
, PlotterType.MULTISCATTER
PlotterType.MULTIMATRIXSCATTERBIN
.
The currently available custom styles for plotting matrices are:
bcm2711b0_layout
: a style that plots a matrix over the layout of the bcm2711b0.bcm2711b0_layout_bw
: a style that plots a matrix over the black and white layout of the bcm2711b0.bcm2711b0_layout_multimatrixbin
: a style that plots several matrices over the black and white layout of the bcm2711b0.intel_core_i3
: style that plots a matrix over an opened Intel Core i3-6100T.bcm2837
: a style that plots a matrix over a bcm2837 component.bcm2837_multimatrixbin
: style that plots several matrices over a bcm2837 component.
All the styles that are used to plot over an image are scatter plots.
Plotting data
It is possible to plot data. To do so, one must use the plot
command with the index of the manip, the index of the result of this manip to plot, the style to use but also the columns to use as data and the column to use as labels.
plot $MANIP_INDEX $RESULT_INDEX $STYLE $DATA_COLUMN $LABEL_COLUMN
The columns to use must all be in the same result. If you want to plot data from different manip, use the merge
command before plotting.
For instance:
# Tested with experiment bcm2711b0_orrR5_iv5_laser_20x_4v_20ns_carto_core_20200211
plot 4 1 bar 3 0
It is possible to plot various set of data in the same plot using “multi” styles. For instance:
plot 4 1 multibar 3,1 0
Pre-built data styles
Various styles are already implemented for plotting data.
They are defined in the plot/plot_styles.py
file. A style is a dictionary containing the rules for plotting the result, they are based on the Plotter Python package.
The currently available custom styles for plotting data are:
large_dist
: a style made for plotting large amount of data by adjusting the labels size and by rotating them. This style plots the data the same way asbar
.pie
: plots the data as a pie.bar
: plots a single set of data as bars.multibar
: plots several sets of data as bars.marked_plot
: plots a set of data as dots with links.marked_multiplot
: plots several sets of data as dots with links.
Create a new plot style
To create a new plot style, it is only necessary to create a plot dictionary style suitable with the Plotter Python package and to add it to the styles
dictionnary in the plot/plot_styles.py
file.
Exporting to Tikz
It is possible to export a plotted figure using the command tikz
instead of the plot command. It is also possible to add a name to the tikz file. For instance:
# Tested with experiment bcm2711b0_orrR5_iv5_laser_20x_4v_20ns_carto_core_20200211
tikz 4 1 bar 3 0 my_tikz.tex
This command will save the figure generated by the plot 4 1 bar 3 0
command into the my_tikz.tex
file. This file will be located at in the {MAIN_DIR}/tikz/
directory.
It is possible to customize the target directory by modifying the tikz_dir
option in the config.py
file.
The tikz exportations does not work correctly for matrices. It is recommanded to export them as a .pdf
file directly from the Matplotlib
interface.