Navigation

  • index
  • modules |
  • next |
  • previous |
  • pyLaserPulse 0.0.0 documentation »
  • pyLaserPulse.single_plot_window.matplotlib_gallery

pyLaserPulse.single_plot_window.matplotlib_gallery¶

Functions

concatenate_plot_dicts(dict_list)

Take all dictionaries in list dict_list and turn them into one dictionary.

launch_plot(plot_dicts)

Launch the MatplotlibGallery.

savePlotFunc(plotInfo, plotName, directory)

Almost the same as MatplotlibGaller.makePlot.

Classes

MatplotlibGallery(*args, **kwargs)

parallelPlotSaver(*args, **kwargs)

Worker class for saving all plots in parallel

pyLaserPulse.single_plot_window.matplotlib_gallery.launch_plot(plot_dicts)¶

Launch the MatplotlibGallery.

plot_dicts: list.

List of plot dictionaries produced by optical assembly classes.

pyLaserPulse.single_plot_window.matplotlib_gallery.concatenate_plot_dicts(dict_list)¶

Take all dictionaries in list dict_list and turn them into one dictionary.

dict_list: list of dictionaries.

pyLaserPulse.single_plot_window.matplotlib_gallery.savePlotFunc(plotInfo, plotName, directory)¶

Almost the same as MatplotlibGaller.makePlot.

Redefining AGAIN because MplWidget objects aren’t pickleable. Need to replot everything to use multiprocessing library. This ends up being faster in the long run.

I don’t think it’s possible to define the thumbnails or the pop-out plots from MatplotlibGallery.onMplWidgetClick using this function. Returning an smw.MatplotlibWindow object doesn’t seem to work (‘wrapper to C/C++ object has been deleted’).

Parameters:
  • plotInfo – tuple. (axis object, list of formatting commands as strings).

  • plotName – string. Name given to the plot.

  • directory – string. Absolute directory to which plots are to be saved.

class pyLaserPulse.single_plot_window.matplotlib_gallery.MatplotlibGallery(*args: Any, **kwargs: Any)¶
__init__(plot_dicts=[], windowTitle=None, dpi=96)¶

Application that puts all plots in a single window. Plots can be opened in their own large window by clicking on the thumnails.

plot_dicts: list.

List containing all dictionaries of plot information from the amplifier objects. The following naming convention MUST be followed: “amplifier name: plot name”

windowTitle: str.

Title of the window.

dpi: int

Screen dpi.

James Feehan, 17/5/2022

groupBoxLabelsFromDict()¶

Creates a list of labels for the amplifier group boxes using self.plot_dicts.keys(). The following naming convention MUST be followed: “GROUPNAME: plot title”.

makeGalleryGroupBoxes()¶

Populate self.ui.groupBox_gallery with one group box for each amplifier simulated.

The groupBoxes are enumerated and labelled according to self.groupBoxLabels, so self.groupBoxLabelsFromDict() must be called first and the naming convention must be followed.

populateGalleryGroupBoxes()¶

Add MplWidgets to all groupboxes in self.galleryGroupBoxList.

onMplWidgetClick(plotInfo, plotName)¶

Launch new window containing only an MplWidget and plot the data in plotdict.

Parameters:
  • plotInfo – tuple. (axis object, list of formatting commands as strings).

  • plotName – string.

  • groupBoxLabel – None or string. Name of the groupBox that the plots are put in. This is prepended to the file name when saving all plots.

makePlot(plotWidget, plotInfo, thumbnail=True)¶

Update plotWidget.

Parameters:
  • plotWidget – MplWidget object.

  • plotInfo – tuple. (axis object, list of formatting commands as strings).

  • thumbnail – bool (default True). Misses font formatting, legend, etc assuming that the resulting plot will be too small to read these features.

saveAllPlots()¶

Make and save, but do not display, all plots in the gallery.

A dialogue box opens so that that user can select the directory where the plots are to be saved.

changeStatusLabel(statString)¶

Change the status label test.

class pyLaserPulse.single_plot_window.matplotlib_gallery.parallelPlotSaver(*args: Any, **kwargs: Any)¶

Worker class for saving all plots in parallel

Table of Contents

  • pyLaserPulse.single_plot_window.matplotlib_gallery
    • launch_plot()
    • concatenate_plot_dicts()
    • savePlotFunc()
    • MatplotlibGallery
      • MatplotlibGallery.__init__()
      • MatplotlibGallery.groupBoxLabelsFromDict()
      • MatplotlibGallery.makeGalleryGroupBoxes()
      • MatplotlibGallery.populateGalleryGroupBoxes()
      • MatplotlibGallery.onMplWidgetClick()
      • MatplotlibGallery.makePlot()
      • MatplotlibGallery.saveAllPlots()
      • MatplotlibGallery.changeStatusLabel()
    • parallelPlotSaver

Previous topic

pyLaserPulse.pump

Next topic

pyLaserPulse.sys_info

This Page

  • Show Source

Quick search

Navigation

  • index
  • modules |
  • next |
  • previous |
  • pyLaserPulse 0.0.0 documentation »
  • pyLaserPulse.single_plot_window.matplotlib_gallery
© Copyright 2023, James Feehan. Created using Sphinx 8.2.3.