Display#

pyemaps.display.showDif(dpl=None, cShow=True, kShow=True, iShow=True, layout='individual', bSave=False, bClose=False)#

Plot kinematic diffraction patterns, one plot per pattern.

Parameters:
  • dpl (DPList) – the patterns, with their controls.

  • cShow (bool, optional) – write the non-default controls in the lower left corner of each plot.

  • kShow (bool, optional) – draw the Kikuchi lines.

  • iShow (bool, optional) – label the diffracted beams with their Miller indices.

  • layout (str, optional) – 'individual' (the default) to show the patterns one at a time, or 'table' to show them in a table three columns wide.

  • bSave (bool, optional) – save each plot to a file: the file is saved as a PNG in the dif folder of the pyEMAPS data folder, named after dpl.name and the time. On Linux without a display, the plots are always saved.

  • bClose (bool, optional) – close the plot window 3 seconds after the last plot. By default, you close it yourself.

Raises:

DPListError – if dpl isn’t a DPList.

If dpl has no patterns, it prints a message and plots nothing.

In a Jupyter notebook, the plots are drawn in the notebook instead of a plot window: one figure per pattern with the 'individual' layout, or one figure for the 'table' layout. bClose doesn’t apply there, and bSave saves every figure, numbered when there are several.

pyemaps.display.showBloch(bimgs, cShow=True, bColor=False, layout='individual', bSave=False, bClose=False)#

Plot dynamic diffraction (Bloch) images, one plot per image.

Parameters:
  • bimgs (BImgList) – the images, with their controls.

  • cShow (bool, optional) – write the non-default controls in the lower left corner of each plot.

  • bColor (bool, optional) – use a color map instead of grayscale.

  • layout (str, optional) – 'individual' (the default) to show the images one at a time, or 'table' to show them in a table three columns wide.

  • bSave (bool, optional) – save each plot to a file: the file is saved as a PNG in the bloch folder of the pyEMAPS data folder, named after bimgs.name and the time. On Linux without a display, the plots are always saved.

  • bClose (bool, optional) – close the plot window 3 seconds after the last plot. By default, you close it yourself.

Raises:

BlochListError – if bimgs is empty or isn’t a BImgList.

In a Jupyter notebook, the plots are drawn in the notebook instead of a plot window: one figure per image with the 'individual' layout, or one figure for the 'table' layout. bClose doesn’t apply there, and bSave saves every figure, numbered when there are several.

pyemaps.display.showStereo(slist, name, cShow=True, iShow=False, zLimit=2, layout='individual', bSave=False, bClose=False)#

Plot stereodiagrams, one plot per stereodiagram.

Parameters:
  • slist (list of tuple) – the stereodiagrams, as a list of (emc, stereo) pairs: the controls, and the output of generateStereo() for them.

  • name (str) – the crystal name, used in the window title and in saved file names.

  • cShow (bool, optional) – write the non-default controls in the lower left corner of each plot.

  • iShow (bool, optional) – label the poles with their Miller indices.

  • zLimit (int, optional) – label only the poles whose Miller indices are all within this value. With the default of 2, (3, 1, 0) isn’t labeled. All poles are drawn either way.

  • layout (str, optional) – 'individual' (the default) to show the stereodiagrams one at a time, or 'table' to show them in a table three columns wide.

  • bSave (bool, optional) – save each plot to a file: the file is saved as a PNG in the stereo folder of the pyEMAPS data folder, named after name and the time. On Linux without a display, the plots are always saved.

  • bClose (bool, optional) – close the plot window 3 seconds after the last plot. By default, you close it yourself.

In a Jupyter notebook, the plots are drawn in the notebook instead of a plot window: one figure per stereodiagram with the 'individual' layout, or one figure for the 'table' layout. bClose doesn’t apply there, and bSave saves every figure, numbered when there are several.

pyemaps.display.plot2Powder(pw1, pw2, bClose=True, titles=('', ''), ylabels=('Intensity', 'Intensity'))#

Plot two powder diffraction profiles from generatePowder(), one above the other.

Parameters:
  • pw1 (numpy.ndarray) – the upper profile: a 2 × N array of scattering angles and intensities.

  • pw2 (numpy.ndarray) – the lower profile, in the same form.

  • bClose (bool, optional) – close the plot after about 3 seconds. Otherwise the plot doesn’t block, and stays open until the program ends. In a Jupyter notebook, the plot is drawn in the notebook, and bClose doesn’t apply.

  • titles (tuple of str, optional) – the titles of the upper and lower plots. Defaults to no titles.

  • ylabels (tuple of str, optional) – the y-axis labels of the upper and lower plots. Defaults to “Intensity” for both.

The powder sample, for example, compares Silicon with Diamond calculated with absorption:

plot2Powder(psi, pdi, titles=('Silicon', 'Diamond'),
            ylabels=('Intensity', 'Intensity /w Absorption'))