plot

Functions and attributes

atomman.plot.interpolate_contour(system, name, property=None, index=None, magnitude=False, plotxaxis='x', plotyaxis='y', xlim=None, ylim=None, zlim=None, xbins=200, ybins=200, dots=True, czero=True, save=False, show=True, length_unit='angstrom', property_unit=None, cmap='jet')

Creates a contour plot of a system’s per-atom properties by interpolating properties between atoms.

Parameters
  • system (atomman.System) – The system with the per-atom property that you want to plot.

  • name (str) – The name of the per-atom property that you want to plot.

  • property (array-like object, optional) – Values for the per-atom property to plot. If not given, values will be taken as the “name” property of system.

  • index (int or tuple, optional) – Specifies which component of a multidimensional property to plot. Not needed if the property is scalar.

  • magnitude (bool, optional) – If True, plots the per-atom magnitude of a vector property. Cannot be combined with index. Default value is False.

  • plotxaxis (str or array-like object, optional) – Indicates the Cartesian direction associated with the system’s atomic coordinates to align with the plotting x-axis. Values are either 3D unit vectors, or strings ‘x’, ‘y’, or ‘z’ for the Cartesian axes directions. plotxaxis and plotyaxis must be orthogonal. Default value is ‘x’ = [1, 0, 0].

  • plotyaxis (str or array-like object, optional) – Indicates the Cartesian direction associated with the system’s atomic coordinates to align with the plotting y-axis. Values are either 3D unit vectors, or strings ‘x’, ‘y’, or ‘z’ for the Cartesian axes directions. plotxaxis and plotyaxis must be orthogonal. Default value is ‘y’ = [0, 1, 0].

  • xlim (tuple, optional) – The minimum and maximum coordinates along the plotting x-axis to include in the fit. Values are taken in the specified length_unit. If not given, then the limits are set based on min and max atomic coordinates along the plotting axis.

  • ylim (tuple, optional) – The minimum and maximum coordinates along the plotting y-axis to include in the fit. Values are taken in the specified length_unit. If not given, then the limits are set based on min and max atomic coordinates along the plotting axis.

  • zlim (tuple, optional) – The minimum and maximum coordinates normal to the plotting axes (i.e. plotxaxis X plotyaxis) to include in the fit. Values are taken in the specified length_unit. If not given, then the limits are set based on min and max atomic coordinates along the axis.

  • xbins (int, optional) – Specifies the number of interpolation bins to use along the plotting x-axis. Default value is 200.

  • ybins (int, optional) – Specifies the number of interpolation bins to use along the plotting y-axis. Default value is 200.

  • dots (bool, optional) – If True, then the positions of the atoms are shown as circles. Default value is True.

  • czero (bool, optional) – If True, the range of property values will be centered around zero, i.e. cmax = -cmin. If False, cmax and cmin will be independently selected using the property values. Default value is True.

  • save (bool, optional) – If True, the generated plot will be saved to “name.png”. Default value is False.

  • show (bool, optional) – If True, matplotlib.pyplot.show() is called. Default value is True.

  • length_unit (str, optional) – The units of length to use for the plotting x- and y-axes. Default value is ‘angstrom’.

  • property_unit (str or None, optional) – The units to use for the property value being plotted. Default value is None, in which no unit conversion is applied.

  • cmap (str, optional) – The name of the matplotlib colormap to use. Default value is ‘jet’.

Returns

  • intsum (float) – The area integrated sum of the property over the plotted region.

  • avsum (float) – The average property value taken across all plotting bins.