Plotting API#

h_transport_materials.plotting.get_prop_to_color(group: h_transport_materials.properties_group.PropertiesGroup, colour_by: str)[source]#

Returns a dictionary mapping Property objects to a colour based on a property attribute

Parameters
  • group (PropertiesGroup) – a group of properties

  • colour_by (str) – a property attribute to colour by (eg. “author”, “isotope”, “material”)

Returns

a dictionary mapping properties to colours

Return type

dict

h_transport_materials.plotting.line_labels(ax=None, min_label_distance: float = 'auto', alpha: float = 1.0, **text_kwargs)[source]#

Adapted from matplotx

h_transport_materials.plotting.plot(prop: Union[h_transport_materials.property.Property, h_transport_materials.properties_group.PropertiesGroup], T_bounds=(300, 1200), inverse_temperature=True, auto_label=True, show_datapoints=True, scatter_kwargs={}, colour_by='property', **kwargs)[source]#

Plots a Property object on a temperature plot

Parameters
  • prop (Property or PropertiesGroup) – the property (or group of properties) to plot.

  • T_bounds (tuple, optional) – If the property doesn’t have a temperature range, this range will be used. Defaults to (300, 1200).

  • inverse_temperature (bool, optional) – If True, the x axis will be the inverse temperature (in K^-1). Defaults to True.

  • auto_label (bool, optional) – If True, a label will be automatically generated from the isotope, author and year. Ignored if label is set in kwargs. Defaults to True.

  • show_datapoints (bool, optional) – If True, the experimental datapoints will be scattered too. Defaults to True.

  • scatter_kwargs (dict, optional) – other matplotlib.pyplot.scatter arguments. Defaults to {}.

  • colour_by (str, optional) – a property attribute to colour by (eg. “author”, “isotope”, “material”). Defaults to “property”.

  • kwargs – other matplotlib.pyplot.plot arguments

Returns

the Line2D artist

Return type

matplotlib.lines.Line2D