wireservice / leather

Python charting for 80% of humans.
https://leather.readthedocs.io
MIT License
330 stars 30 forks source link

Use axis_title_font_size and tick_font_size. #104

Closed Math-ias closed 1 year ago

Math-ias commented 2 years ago

Commit c3654820b386e53daab9ea53e43738579fb85f18 added a # of options for axis titles to theme.py. All of these options are used except for font_size. Similarly, all theme options for ticks are used except font_size.

This commit uses those properties.

To reproduce ...

import leather, math

leather.theme.title_font_size = 40
leather.theme.axis_title_font_size = 40
leather.theme.tick_font_size = 40

chart = leather.Chart("Title")
chart.add_line([(x, math.sin(x)) for x in range(-10,10)])
chart.add_x_axis(name="X Axis")
chart.add_y_axis(name="Y Axis")
print(chart.to_svg())

Before ... example_before

After ... (all text is now the same size) example_after

I use six.text_type instead of str to respect precedent but also keep 2/3 compatibility.

jpmckinney commented 1 year ago

Can you use str() instead? Leather no longer supports Python 2.