calplot icon indicating copy to clipboard operation
calplot copied to clipboard

findfont: Font family 'Helvetica' not found.

Open bkimball98 opened this issue 2 years ago • 5 comments

Good morning,

I am developing a calendar heatmap using your package, and it appears the font you have chosen as default ('Helvetica') is no longer supported by matplotlib? Or at the very least does not work on my environment.

OS: Windows 10 Python Version: 3.9.13 calplot==0.1.7.5

Behavior:

  • when returning a plot from a call to calplot.calplot(), the following warning is printed: findfont: Font family 'Helvetica' not found.

I traced the problem to line 327 in calplot.py, where the following code exists:

ylabel_kws = dict(
    fontsize=30,
    color='gray',
    fontname='Helvetica',
    fontweight='bold',
    ha='center')
ylabel_kws.update(yearlabel_kws)

Changing the 'fontname' key from Helvetica to sans-serif fixed the issue.

Could you perhaps add an argument to calplot.calplot() to let us specify the font type in your next release?

Thanks.

bkimball98 avatar Jan 19 '23 16:01 bkimball98

Hi! I faced the same issue with the same release (0.1.7.5). I found that passing your desired font (in this case 'sans-serif') to the parameter yearlabel_kws can solve the problem:

calplot.calplot(events, yearlabel_kws={'fontname':'sans-serif'})

Mayitzin avatar Mar 06 '23 00:03 Mayitzin

Facing same Issue!

lamyergeier avatar Apr 07 '23 15:04 lamyergeier

Same issue here on Linux. Would be great to have a non-proprietary font as the default.

belasco avatar May 05 '24 18:05 belasco

Hi! I faced the same issue with the same release (0.1.7.5). I found that passing your desired font (in this case 'sans-serif') to the parameter yearlabel_kws can solve the problem:

calplot.calplot(events, yearlabel_kws={'fontname':'sans-serif'})

This appears to be a working solution, thanks.

LPD-9 avatar May 11 '24 20:05 LPD-9