pySIMsalabim.plots package

Submodules

pySIMsalabim.plots.band_diagram module

Draw the energy band diagram

pySIMsalabim.plots.band_diagram.create_energy_label(x_left, x_right, L, y, band_type, position, ax, vert_pos='top')[source]

Create and place the label for an energy level (in eV) of a layer

Parameters:
  • x_left (float) – Left x position of the layer [m]

  • x_right (float) – right x position of the layer [m]

  • L (float) – Full width of the device [m]

  • y (float) – Energy of the band [eV]

  • band_type (string) – Type of band (CB, VB, Electrode)

  • position (float) – Full length of the device

  • ax (axes) – Axes object for the plot

pySIMsalabim.plots.band_diagram.create_width_label(x_left, x_right, x_corr, value, y_min, ax, color)[source]

Create the label to display the width of a layer on the width bar

Parameters:
  • x_left (float) – Left x position of the layer [m]

  • x_right (float) – right x position of the layer [m]

  • x_corr (float) – Correction factor to place the label in the middle of the layer

  • value (float) – Width of the layer [m]

  • y_max (float) – Lowest energy level of the device [eV]

  • ax (axes) – Axes object for the plot

  • color (string) – Color of the label

pySIMsalabim.plots.band_diagram.get_param_band_diagram(dev_par, layers, dev_par_name)[source]

Create and display the band diagram on the UI based on the relevant parameters from the dict object

Parameters:
  • dev_par (dict) – Dictionary with all data

  • layers (List) – List with all the layers in the device

  • dev_par_name (string) – Name of the device parameter file

pySIMsalabim.plots.band_diagram.plot_band_diagram(dev_par_file_name, session_path)[source]

Plot the band diagram of the device based on the device parameter file and the session path

Parameters:
  • dev_par_file_name (string) – Name of the device parameter file

  • session_path (string) – Path to the session folder

pySIMsalabim.plots.band_diagram.plot_device_widths(ax, y_min, L, L_original)[source]

Plot a width bar below the band energy diagram with the thickness of each layer.

Parameters:
  • ax (axes) – Axes object for the plot

  • y_max (float) – Lowest energy level [eV]

  • L (float) – Full width of the device [m]

  • L_original (List) – List with the layer widths before scaling

pySIMsalabim.plots.plot_def module

Global settings for plots

pySIMsalabim.plots.plot_functions module

Functions for plotting

pySIMsalabim.plots.plot_functions.plot_result(data, pars, selected, x_key, xlabel, ylabel, xscale, yscale, title, ax, plot_funcs, x_error=[], y_error=[], legend=True, error_fmt='-')[source]

Make a plot for a (sub)set of parameters from a DataFrame. Note: errorbars only work with single x,y functions

Parameters:
  • data (DataFrame) – Data to plot

  • pars (dict) – Dict with all potential parameters to plot. Keys represent the names in the dataFrama, values are the corresponding labels

  • selected (list) – List with the names of the selected parameters to plot. Names match the names in the dataFrame. TO use all parameters, set selected to list(pars.keys())

  • x_key (string) – Key in the dataframe for the ‘x’ axis data

  • xlabel (string) – Label for the x-axis. Format: parameter [unit]

  • ylabel (string) – Label for the y-axis. Format: parameter [unit]

  • xscale (string) – Scale of the x-axis. E.g linear or log

  • yscale (string) – Scale of the y-axis. E.g linear or log

  • title (string) – Title of the plot

  • ax (axes) – Axes object for the plot

  • plot_funcs (Any) – Type of plot, e.g. standard plot or scatter

  • x_error (List, optional) – List with error on the x parameter, by default []

  • y_error (List, optional) – List with the error on the y parameter, by default []

  • legend (bool, optional) – Toggle between showing the legend in the plot, by default True

  • error_fmt (str, optional) – Format of the errorbars, by default ‘-’

Returns:

Updated Axes object for the plot

Return type:

axes

pySIMsalabim.plots.plot_functions.plot_result_colorbar_single(x, y, weight, ax, fig, xlabel, ylabel, weight_label, weight_norm, title, xscale='linear', yscale='linear')[source]

Show a x,y plot but use a colorbar to indicate a third parameter, similar to adding a weight to each point.

Parameters:
  • x (array) – Array with the x-data to plot

  • y (array) – Array with the y data to plot

  • weight (array) – Array with the weights for the colorbar

  • ax (axes) – Axes object for the plot

  • fig (figure) – Figure object for the plot

  • xlabel (string) – label for the x-axis

  • ylabel (string) – label for the y-axis

  • weight_label (string) – label for the weights/colorbar

  • weight_norm (string) – the scale for the colorbar, ‘linear’ or ‘log’

  • title (string) – Title of the plot

  • xscale (str, optional) – set the scale of the x-axis, by default ‘linear’

  • yscale (str, optional) – set the scale of the y-axis, by default ‘linear’

Returns:

return the axes,figure objects

Return type:

ax,fig

pySIMsalabim.plots.plot_functions.plot_result_twinx(data, pars, selected_1, selected_2, x_key, xlabel, ylabel_1, ylabel_2, xscale, yscale_1, yscale_2, title, ax1, ax2, plot_funcs, x_error=[], y_error_1=[], y_error_2=[])[source]

Plot data on two y axis with a shared x axis. DIfferentiate between regular and errorbar plots.

Parameters:
  • data (DataFrame) – Data to plot

  • pars (dict) – Dict with all potential parameters to plot. Keys represent the names in the dataFrama, values are the corresponding labels

  • selected_1 (List) – List with the names of the selected parameters to plot on the left y axis. Names match the names in the dataFrame. TO use all parameters, set selected to list(pars.keys())

  • selected_2 (List) – List with the names of the selected parameters to plot on the right y axis. Names match the names in the dataFrame. TO use all parameters, set selected to list(pars.keys()) x_key : _type_ _description_

  • xlabel (string) – Label for the x-axis. Format: parameter [unit]

  • ylabel_1 (string) – Label for the left y-axis. Format: parameter [unit]

  • ylabel_2 (_type_) – Label for the right y-axis. Format: parameter [unit]

  • xscale (string) – Scale of the x-axis. E.g linear or log

  • yscale_1 (string) – Scale of the left y-axis. E.g linear or log

  • yscale_2 (string) – Scale of the right y-axis. E.g linear or log

  • title (string) – Title of the plot

  • ax1 (axes) – Axes object for the plot

  • ax2 (axes) – Axes object for the plot (right y axis)

  • plot_funcs (any) – Type of plot, e.g. standard plot or scatter

  • x_error (list, optional) – _description_, by default []

  • y_error_1 (list, optional) – List with error on the x parameter, by default []

  • y_error_2 (list, optional) – List with error on the x parameter, by default []

Module contents