MCPcopy Index your code
hub / github.com/spotify/chartify / _text_example_1

Function _text_example_1

chartify/examples.py:235–258  ·  view source on GitHub ↗

Plot text with scatter

(price_and_quantity_by_country)

Source from the content-addressed store, hash-verified

233
234@_print_source
235def _text_example_1(price_and_quantity_by_country):
236 """Plot text with scatter"""
237 # Plot the data
238 ch = chartify.Chart(blank_labels=True)
239 ch.plot.scatter(
240 data_frame=price_and_quantity_by_country,
241 x_column="total_price",
242 y_column="quantity",
243 color_column="country",
244 )
245 ch.style.color_palette.reset_palette_order()
246 ch.plot.text(
247 data_frame=price_and_quantity_by_country,
248 x_column="total_price",
249 y_column="quantity",
250 text_column="country",
251 color_column="country",
252 x_offset=1,
253 y_offset=-1,
254 font_size="10pt",
255 )
256 ch.set_title("Text")
257 ch.set_subtitle("Labels for specific observations.")
258 ch.show(_OUTPUT_FORMAT)
259
260
261plot_text.__doc__ = _core.plot.PlotNumericXY.text.__doc__

Callers 1

plot_textFunction · 0.85

Calls 6

set_titleMethod · 0.95
set_subtitleMethod · 0.95
showMethod · 0.95
reset_palette_orderMethod · 0.80
scatterMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected