Plot text with scatter
(price_and_quantity_by_country)
| 233 | |
| 234 | @_print_source |
| 235 | def _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 | |
| 261 | plot_text.__doc__ = _core.plot.PlotNumericXY.text.__doc__ |
no test coverage detected