scanpy icon indicating copy to clipboard operation
scanpy copied to clipboard

Fix font stack

Open flying-sheep opened this issue 6 years ago • 5 comments

Continuation from #805, cc @gokceneraslan @falexwolf

Why do we change Matplotlib "font.sans-serif" anyway?

Alex started replacing fonts from the beginning:

https://github.com/theislab/scanpy/blob/c22e48abe45a6ccca5918bbf689637caa4b31250/scanpy/plotting.py#L605

He then updated them to the stack we have now:

https://github.com/theislab/scanpy/blob/6c68b8ba2821f27bd0b8f499a1d543dff9cc51b2/scanpy/plotting.py#L763-L767

There’s some known metrically compatible fonts, but our stack doesn’t reflect that, as e.g. DejaVu Sans isn’t metrically compatible to Arial and Helvetica.

Is the default matplotlib stack better or can we at least gain inspiration from it? What would be a safe stack to use on most OSs (even if that means fiddling with our plots if we change the stack to not-Helvetica-like)

flying-sheep avatar Oct 29 '19 10:10 flying-sheep

I think Arial was set as default as it's required for Nature publications. I set the font to arial for a manuscript manually, and then noticed that it's default already.

LuckyMD avatar Nov 13 '19 12:11 LuckyMD

required for Nature publications

OK Nature is garbage now :laughing: (but seriously what are they thinking)

Can we cheat and use a font stack that uses metrically compatible but actually palatable fonts before trying Arial?

flying-sheep avatar Nov 13 '19 13:11 flying-sheep

A little off topic, but if we want to put effort into setting a preferred font, do we also want to make it the default one people see in their plots?

ivirshup avatar Nov 20 '19 06:11 ivirshup

Is it not?

flying-sheep avatar Nov 20 '19 12:11 flying-sheep

I don't think so, not unless you call sc.set_figure_params(). But this modifies the global config.

ivirshup avatar Nov 21 '19 01:11 ivirshup