Replies: 1 comment
-
Hey @mrm4343 you can filter multiple plots by the same plot_list = ([
dp.Group(
dp.Plot(
df[df['Country/Region'] == country].plot.line(x='Date', y='Confirmed'),
label=country,
),
dp.Plot(
df[df['Country/Region'] == country].plot.line(x='Date', y='Deaths'),
label=country,
),
columns=2,
label=country,
) for country in country_list
]) See here for example: https://datapane.com/reports/j3LgEQA/mpl-filters/ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been able to create plot filters using the example on the datapane website. I would like to have multiple plots controlled by the same filter. Basically I have multiple plots which share an attribute that I would like to filter by. Is this possible?
import pandas as pd
import matplotlib.pyplot as plt
import datapane as dp
df = pd.read_csv("./covid_19_clean_complete.csv")
country_list = list(df['Country/Region'].unique())[:10]
plt.figure(figsize=(10, 5), dpi=300)
I need multiple plots. So more sets of x and y which are also filtered by country.
plot_list = ([dp.Plot(df[df['Country/Region']==country].plot.line(x='Date', y='Confirmed'), label=country)
for country in country_list])
report = dp.Report(
dp.Select(blocks = plot_list)
).upload(name="Matplotlib example")
Beta Was this translation helpful? Give feedback.
All reactions