Reflex Cloud - Fast, secure & scalable hosting. One command to deploy.

Pyplot

Pyplot (reflex-pyplot) is a graphing library that wraps Matplotlib. Use the pyplot component to display any Matplotlib plot in your app. Check out Matplotlib for more information.

Installation

Install the reflex-pyplot package using pip.

Basic Example

To display a Matplotlib plot in your app, you can use the pyplot component. Pass in the figure you created with Matplotlib to the pyplot component as a child.

Stateful Example

Lets create a scatter plot of random data. We'll also allow the user to randomize the data and change the number of points.

In this example, we'll use a color_mode_cond to display the plot in both light and dark mode. We need to do this manually here because the colors are determined by the matplotlib chart and not the theme.

Number of Points:

API Reference

pyplot

Display a Matplotlib chart.

Props

No component specific props