intel / p3-analysis-library

A library simplifying the collection and interpretation of P3 data.
https://intel.github.io/p3-analysis-library/
MIT License
7 stars 10 forks source link

cascade plot legend isn't aligned with platform chart #21

Open Pennycook opened 11 months ago

Pennycook commented 11 months ago

Expected behavior

It should be possible to align the platform chart legend with the platform chart.

image

Actual behavior

The current behavior places the legend slightly too low, and the spacing between entries is off.

image

Steps to reproduce the problem

This is the default behavior for all cascade plots.

Specifications

p3==0.1.0
Pennycook commented 3 weeks ago

I've done some experimenting with this today, and there are a few options to legend that are helfpul:

The problem seems to be that all of these values are in font-sized units, not axis-sized units. The following produces reasonable results at the default plot settings:

frameon=False,
borderpad=0.4,
borderaxespad=0,
labelspacing=0.525,

...but hard-coding so many magic constants into the cascade plot script seems like a very bad idea, and I suspect that the values will produce bad results if plots are resized or customized in any way.

It may be a better idea to try and think of another way to make use of the whitespace in the bottom-right corner, and then move the legend(s) somewhere else.