Plotting tools

Plot data from either arrays or dataframes using Plotly with figrecipes

In the figrecipes partner code to the matminer library, we have developed utilities that make it easier and faster to plot common figures with Plotly. The figrecipes module is aimed at making it easy for the user to create plots from their data using just a few lines of code, utilizing the wide and flexible functionality of Plotly, while at the same time sheilding the complexities involved.

Check out an example code and figure generated with figrecipes:

from matminer import PlotlyFig
from matminer.datasets import load_dataset
df = load_dataset("elastic_tensor_2015")
pf = PlotlyFig(
    y_title='Bulk Modulus (GPa)',
    x_title='Shear Modulus (GPa)',

    ('G_VRH', 'K_VRH'),
    limits={'x': (0, 300)}

This code generates the following figure from the matminer elastic dataset dataframe.

The figrecipes code contains the PlotlyFig class that wraps around Plotly’s Python API and follows its JSON schema. Check out the examples below to see how to use the plotting functionality!


You can find examples of the figrecipes code in the matminer_examples.

Code documentation

Autogenerated code documentation below: