MCPcopy Create free account
hub / github.com/spotify/chartify / plot_area

Function plot_area

chartify/examples.py:265–286  ·  view source on GitHub ↗

Area example

()

Source from the content-addressed store, hash-verified

263
264@_print_source
265def plot_area():
266 """
267 Area example
268 """
269 import pandas as pd
270 import chartify
271
272 # Generate example data
273 data = chartify.examples.example_data()
274
275 total_quantity_by_month_and_fruit = (
276 data.groupby([data["date"] + pd.offsets.MonthBegin(-1), "fruit"])["quantity"]
277 .sum()
278 .reset_index()
279 .rename(columns={"date": "month"})
280 .sort_values("month")
281 )
282 print(total_quantity_by_month_and_fruit.head())
283 """Print break"""
284 _area_example_1(total_quantity_by_month_and_fruit)
285 _area_example_2(total_quantity_by_month_and_fruit)
286 _plot_shaded_interval(data)
287
288
289@_print_source

Callers

nothing calls this directly

Calls 3

_area_example_1Function · 0.85
_area_example_2Function · 0.85
_plot_shaded_intervalFunction · 0.85

Tested by

no test coverage detected