octadist.draw

class octadist.src.draw.DrawComplex_Matplotlib(atom=None, coord=None, cutoff_global=2.0, cutoff_hydrogen=1.2)[source]

Display 3D structure of octahedral complex with label for each atoms using Matplotlib.

Parameters:
  • atom (list) – Atomic symbols of octahedral structure. Default is None.

  • coord (list or array_like or tuple or bool) – Atomic coordinates of octahedral structure. Default is None.

  • cutoff_global (int or float) – Global cutoff for screening bonds. Default is 2.0.

  • cutoff_hydrogen (int or float) – Cutoff for screening hydrogen bonds. Default is 1.2.

See also

draw.DrawComplex_Plotly

Use Plotly engine to draw a complex.

Examples

>>> atom = ['Fe', 'N', 'N', 'N', 'O', 'O', 'O']
>>> coord = [[2.298354000, 5.161785000, 7.971898000],
             [1.885657000, 4.804777000, 6.183726000],
             [1.747515000, 6.960963000, 7.932784000],
             [4.094380000, 5.807257000, 7.588689000],
             [0.539005000, 4.482809000, 8.460004000],
             [2.812425000, 3.266553000, 8.131637000],
             [2.886404000, 5.392925000, 9.848966000]]
>>> test = DrawComplex_Matplotlib(atom=atom, coord=coord)
>>> test.add_atom()
>>> test.add_bond()
>>> test.add_legend()
>>> test.show_plot()
start_plot()[source]

Introduce figure to plot.

plot_title(title='Full complex', font_size='12')[source]

Add plot title at top position.

Parameters:
  • title (str) – Top title of the plot. Default is “Full complex”.

  • fontsize (int or float or str) – Font size of title. Default is “12”.

add_atom()[source]

Add all atoms to show in figure.

add_symbol()[source]

Add symbol of atoms to show in figure.

add_bond()[source]

Calculate bond distance, screen bond, and add them to show in figure.

See also

octadist.src.util.find_bonds

Find atomic bonds.

add_face(coord)[source]

Find the faces of octahedral structure and add those faces to show in figure.

See also

octadist.src.util.find_faces_octa

Find all faces of octahedron.

add_legend()[source]

Add atoms legend to show in figure.

References

  1. Remove duplicate labels in legend.

    Ref: https://stackoverflow.com/a/26550501/6596684.

  2. Fix size of point in legend.

    Ref: https://stackoverflow.com/a/24707567/6596684.

config_plot(show_title=True, show_axis=True, show_grid=True, **kwargs)[source]

Setting configuration for figure.

Parameters:
  • show_title (bool) – If True, show title of figure. If False, not show title of figure.

  • show_axis (bool) – If True, show axis of figure. If False, not show axis of figure.

  • show_grid (bool) – If True, show grid of figure. If False, not show grid of figure.

  • kwargs (dict, optional) – title_name : title name of figure. title_size : text size of title. label_size : text size of axis labels.

static save_img(save='Complex_saved_by_OctaDist', file='png')[source]

Save figure as an image.

Parameters:
  • save (str) – Name of image file. Default is “Complex_saved_by_OctaDist”.

  • file (str) – Image type. Default is “png”.

static show_plot()[source]

Show plot.

class octadist.src.draw.DrawComplex_Plotly(atom=None, coord=None, cutoff_global=2.0, cutoff_hydrogen=1.2)[source]

Display 3D structure of octahedral complex in web browser using Plotly.

Parameters:
  • atom (list) – Atomic symbols of octahedral structure. Default is None.

  • coord (list or array_like or tuple or bool) – Atomic coordinates of octahedral structure. Default is None.

  • cutoff_global (int or float) – Global cutoff for screening bonds. Default is 2.0.

  • cutoff_hydrogen (int or float) – Cutoff for screening hydrogen bonds. Default is 1.2.

See also

draw.DrawComplex_Matplotlib

Use Matplotlib engine to draw a complex.

Examples

>>> atom = ['Fe', 'N', 'N', 'N', 'O', 'O', 'O']
>>> coord = [[2.298354000, 5.161785000, 7.971898000],
             [1.885657000, 4.804777000, 6.183726000],
             [1.747515000, 6.960963000, 7.932784000],
             [4.094380000, 5.807257000, 7.588689000],
             [0.539005000, 4.482809000, 8.460004000],
             [2.812425000, 3.266553000, 8.131637000],
             [2.886404000, 5.392925000, 9.848966000]]
>>> test = DrawComplex_Plotly(atom=atom, coord=coord)
>>> test.add_atom()
>>> test.add_bond()
>>> test.show_plot()
start_plot()[source]

Introduce figure to plot.

plot_title(title='Full complex', font_size='12')[source]

Add plot title at top position.

Parameters:
  • title (str) – Top title of the plot. Default is “Full complex”.

  • fontsize (int or float or str) – Font size of title. Default is “12”.

add_atom()[source]

Add all atoms to show in figure.

add_bond()[source]

Calculate bond distance, screen bond, and add them to show in figure.

See also

octadist.src.util.find_bonds

Find atomic bonds.

save_img(save='Complex_saved_by_OctaDist', file='png')[source]

Save figure as an image. Note that psutil and plotly-orca are needed for saving Plotly plot as image.

Parameters:
  • save (str) – Name of image file. Default is “Complex_saved_by_OctaDist”.

  • file (str) – Image type. Default is “png”.

show_plot()[source]

Show plot.

class octadist.src.draw.DrawProjection(atom=None, coord=None)[source]

Display the selected 4 faces of octahedral complex.

Parameters:
  • atom (list) – Atomic symbols of octahedral structure. Default is None.

  • coord (list or array_like or tuple) – Atomic coordinates of octahedral structure. Default is None.

Examples

>>> atom = ['Fe', 'N', 'N', 'N', 'O', 'O', 'O']
>>> coord = [[2.298354000, 5.161785000, 7.971898000],
             [1.885657000, 4.804777000, 6.183726000],
             [1.747515000, 6.960963000, 7.932784000],
             [4.094380000, 5.807257000, 7.588689000],
             [0.539005000, 4.482809000, 8.460004000],
             [2.812425000, 3.266553000, 8.131637000],
             [2.886404000, 5.392925000, 9.848966000]]
>>> test = DrawProjection(atom=atom, coord=coord)
>>> test.add_atom()
>>> test.add_symbol()
>>> test.add_plane()
>>> test.show_plot()
start_plot()[source]

Introduce figure to plot.

plot_title(title='4 pairs of opposite planes', font_size='x-large')[source]

Add plot title at top position.

Parameters:
  • title (str) – Top title of the plot. Default is “Full complex”.

  • fontsize (int or float or str) – Font size of title. Default is “x-large”.

shift_plot()[source]

Shift subplots down. Default is 0.25.

add_atom()[source]

Add all atoms to show in figure.

add_symbol()[source]

Add all atoms to show in figure.

add_plane()[source]

Add the projection planes to show in figure.

See also

octadist.src.util.find_faces_octa

Find all faces of octahedron.

static save_img(save='Complex_saved_by_OctaDist', file='png')[source]

Save figure as an image.

Parameters:
  • save (str) – Name of image file. Default is “Complex_saved_by_OctaDist”.

  • file (file) – Image type. Default is “png”.

static show_plot()[source]

Show plot.

class octadist.src.draw.DrawTwistingPlane(atom=None, coord=None, symbol_fontsize=15)[source]

Display twisting triangular faces and vector projection.

Parameters:
  • atom (list) – Atomic symbols of octahedral structure. Default is None.

  • coord (list or array or tuple) – Atomic coordinates of octahedral structure. Default is None.

Examples

>>> atom = ['Fe', 'N', 'N', 'N', 'O', 'O', 'O']
>>> coord = [[2.298354000, 5.161785000, 7.971898000],
             [1.885657000, 4.804777000, 6.183726000],
             [1.747515000, 6.960963000, 7.932784000],
             [4.094380000, 5.807257000, 7.588689000],
             [0.539005000, 4.482809000, 8.460004000],
             [2.812425000, 3.266553000, 8.131637000],
             [2.886404000, 5.392925000, 9.848966000]]
>>> test = DrawTwistingPlane(atom=atom, coord=coord)
>>> test.add_plane()
>>> test.add_symbol()
>>> test.add_bond()
>>> test.show_plot()
start_plot()[source]

Introduce figure to plot.

plot_title(title='Projected twisting triangular faces', font_size='x-large')[source]

Add plot title at top position.

Parameters:
  • title (str) – Top title of the plot. Default is “Projected twisting triangular faces”.

  • fontsize (int or float or str) – Font size of title. Default is “x-large”.

shift_plot()[source]

Shift subplots down. Default is 0.25.

create_subplots()[source]

Create subplots.

add_plane()[source]

Add the projection planes to show in figure.

See also

octadist.src.plane.find_eq_of_plane

Find the equation of the plane.

octadist.src.projection.project_atom_onto_plane

Orthogonal projection of point onto the plane.

add_symbol()[source]

Add all atoms to show in figure.

add_bond()[source]

Calculate bond distance, screen bond, and add them to show in figure.

static save_img(save='Complex_saved_by_OctaDist', file='png')[source]

Save figure as an image.

Parameters:
  • save (str) – Name of image file. Default is “Complex_saved_by_OctaDist”.

  • file (str) – Image type. Default is “png”.

static show_plot()[source]

Show plot.