pybec.plotters.plot_FE_E_v_spher

pybec.plotters.plot_FE_E_v_spher(xyz, xyzE, matrix_name, np_name, np_element, to_plot='r', centroid_of='all', sub_mean_field=False, e_field=0.25, e_field_direction=[0, 0, 1], center_dict=None, ref_neg=True, cmap=None, cbar_pos='top', legend=True, figsize=(8, 4), marker_dict=None, color_dict=None, grid=False, alpha=1.0, cbar_shrink=1.0, units='au')[source]

Plots the electric field predicted on each ion by a continuum (FE) approach.

Parameters
  • xyz (str) – File path to the optimized structure .xyz file

  • xyzE (str or dict) – File path to the file containing the FE efield for each atomic coordinate, or Dictionary of electric field values, where the keys are the element symbols, and the values are the Nx3 numpy array of electric field values for all atoms of that element. Ex: xyzE=get_dipole_field(get_coordinates(xyz), get_centroid(blah, key=’Ag’), q=1)

  • matrix_name (str) – Whatever you want to call the matrix, e.g. ‘MgO’

  • np_name (str) – Whatever you want to call the mNP, e.g. ‘Ag8_333’

  • centroid_of (str, optional) – The element you want to calculate the centroid for when calculating and plotting against the distance to centroid. If ‘all’, it will calculate the centroid of the whole unit cell. ‘Ag’ will calculate the centroid of all silver ions in the unit cell in the relaxed structure. defaults to ‘all’

  • sub_mean_field (bool, optional) – If set, the external applied field is subtracted from the calculated fields, meaning that only the local field disturbance caused by the inclusion will be plotted. defaults to True

  • e_field (float, optional) – The applied electric field in V/m. Default: 0.25

  • e_field_direction (int, optional) – The direction the field is applied, where the x-axis is [1,0,0], y-axis is [0,1,0], and z-axis is [0,0,1]. Default: [0,0,1]

  • center_dict (dict, optional) – Custom dictionary specifying where to center each element on the y-axis of the plot, where the keys are element symbols and the values are floats or integers. Default: None Ex: {‘O’: -2, ‘Mg’: 2, ‘Ag’: 0}

  • cmap (string, optional) – The matplotlib colormap style used to color the absolute value of their Born Effective Charge. If None, the data instead will be colored by element using the color_dict colors or default matplotlib ones. Default: None

  • cbar_pos (str, optional) – Where to place the colorbar if cmap is used. Can be ‘top’, ‘right’, or ‘bottom’. Default: ‘top’

  • legend (bool, optional) – Whether to include a legend labelling the different elements. Default: True

  • figsize ((int, int), optional) – Width, Height of the figure. Default: (8,4)

  • marker_dict (dict, optional) – Custom dictionary specifying which markers to use for each element, where the keys are element symbols and the values are valid matplotlib marker symbols. Default: None Ex: {‘O’: ‘o’, ‘Ag’: ‘x’, ‘Mg’: ‘>’}

  • color_dict (dict, optional) – Custom dictionary specifying which colors to use for each element, where the keys are element symbols and the values are valid matplotlib color symbols. Default: None Ex: {‘O’: ‘r’, ‘Ag’: ‘k’, ‘Mg’: ‘y’}

  • grid (bool, optional) – Whether to include grid lines in the plot. Default: False

  • alpha (float, optional) – The alpha channel value for the plot colors. Default: 1.0

  • units (str, optional) – The units for electric field to be added to the y-axis. Default: “au”

Returns

Return type

None