adamerose / PandasGUI

A GUI for Pandas DataFrames
MIT No Attribution
3.19k stars 236 forks source link

Bar and Line title and text #110

Closed fdion closed 3 years ago

fdion commented 3 years ago

Overview

This PR improves titles for bar and for line charts with apply_mean and apply_sort variations. It reflects the correct true observations count or derived observations (due to mean). It also shows the correct aggregation function (count, mean, sum) as is appropriate for the plot.

The other piece of this PR is to add text support to line charts, along with a few basic text attributes for bar and lines:

'textfont_size', 'textfont_color', 'textfont_family', 'textposition', 'texttemplate'

If the above is found to be easy enough to use, the same should be applied to scatter.

Testing

Bar titles

With X only (no Y) and apply_mean: bar_x_only_apply_mean

With X only: bar_x_only

with x and y, no mean or sort: bar_title_no_mean_no_sort

with x and y with sort: bar_title_apply_sort

with x and y with mean and sort: bar_title_apply_mean_apply_sort

Line titles

with apply mean and sort: apply_mean_apply_sort

with sort only: apply_sort

with mean only: apply_mean

and finally with no mean and no sort (adding country for line dash to fully target all observations in the right order without group by or sort) no_mean_no_sort

text

The previous gapminder data, line chart with text = continent:

text_and_redundant_legend

In the above, legend is now redundant. showlegend=False and zooming in provides a great way to quickly see what's happening with GDP by continent in a specific timeframe (also illustrating text attributes):

text_attributes_no_legend

The same can be applied on bar charts:

text_attributes_bar

Closes

This closes #106 This closes #109