Add Custom Plots from Any Library
Latch Plots allows you to install and import any libraries to generate custom plots and display them in the notebook view.
In addition to interactive, no-code Plot cell, Latch Plots allows developers to programmatically use any library and generate plots of interest.
There are two main ways to programmatically create custom plots:
-
Display an image using libraries like
seaborn
ormatplotlib
-
Display a figure from
plotly
Option 1: Display a plot image from seaborn
or matplotlib
Step 1: Install the Python packages
To install your Python libraries, first click on Custom Data Analysis to create a Python cell. Paste in the following Python code to install packages:
Step 2: Display the plot as an image
To display a matplotlib
or seaborn
figure, first assign the figure to a variable, e.g. fig
Click on the fig
variable to display the image in the output of the cell.
Option 2: Display a custom, interactive Plotly figure
First, click on Custom Data Analysis to create a new Python cell. Next, import the Plotly Express library and create your plot of interest.
In the example below, we created a scatter plot for the iris dataset, and save the Plotly object as a Python variable called fig
.
Select the fig
variable to display the interactive Plotly figure in the output of the cell.
Was this page helpful?