Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

real fivethirtyeight / "The Economist" style theme #586

Open
kraxli opened this issue Apr 30, 2022 · 6 comments
Open

real fivethirtyeight / "The Economist" style theme #586

kraxli opened this issue Apr 30, 2022 · 6 comments

Comments

@kraxli
Copy link

kraxli commented Apr 30, 2022

Hi
thanks for your great package! Is there a way to easily (e.g. by theme) make real fivethirtyeight / "The Economist" style plots?
This would (most importantly) include:

  • left align title with y-axis-tick-labels (see second example below)
  • adding a subtitle
  • bolder lines than the current default of theme_538() like matplotlib’s fivethirtyeight style
  • adding a signature bar for e.g. "source" information
  • add colored labels to each plot line / bar / ... instead of a legend by default
  • colorblind-friendly colors

fivethirtyeight

538_title_alignment

the source of the screen shot is How to Generate FiveThirtyEight Graphs in Python where all steps are describe to generate a FiveThirtyEight Graphs (manually) directly by matplotlib.

@has2k1
Copy link
Owner

has2k1 commented May 4, 2022

There isn't a way to do it easily. You would even have to drop down into matplotlib to get the exact look! If I remember correctly, 538 used to do their plots in ggplot2, then finish up in inkscape or some other program. With Matplotlib as backend, placing stuff pixel-perfect around the plot can be very finicky, as you can see at the link.

@kraxli
Copy link
Author

kraxli commented May 5, 2022

Many thanks for coming back! A full fledged theme for 538 may be over the top (especially the line labeling) . However, some elements would probably be feasible. I am thinking of:

  • proper left alignment of title (to some extend already there)
  • subtitles
  • captions / signature bar (left & right / block alignment); I think this is in the pipeline, right?
  • bolder lines than the current default
  • (colorblind-friendly colors) -> not too relevant

P.S. interesting that "Fivethirtyeight" uses ggplot2 with inkscape. Would you know what the journal "The Economist" uses?

@has2k1
Copy link
Owner

has2k1 commented May 5, 2022

  • proper left alignment of title (to some extend already there)
  • subtitles
  • captions / signature bar (left & right / block alignment); I think this is in the pipeline, right?

Given what matplotlib gives us to work with, automatic precise alignment is hard and that affects the 3 points above. I will be exploring this area soon and maybe we could do better.

@kraxli
Copy link
Author

kraxli commented May 5, 2022

Thanks :-)

@has2k1
Copy link
Owner

has2k1 commented May 9, 2023

We now have a layout manager, this feature could not make the upcoming release but will definitely make the one that follows.

@jrr96
Copy link

jrr96 commented May 28, 2023

Thanks a lot for the amazing library!

Not sure if this would be covered by the implementation that you have in mind but I think it might be somewhat related.
I would love to see the possibility of the legend alignment to be done relative to axis+panel, not just panel.

For example, in the latest release, if you use legend position bottom, the legend will appear below the chart, its center aligned in the same vertical of the center of the panel. I would love to have the possibility of aligning it to the center of the combined size of axis and panel.

To me, this causes that when I glance over the chart, the legend seems to be not correctly aligned since my eyes cannot ignore the presence of the axis. It is something very minor but, at least in my eyes, it makes quite a difference in the aesthetics of charts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants