leather
leather copied to clipboard
Use axis_title_font_size and tick_font_size.
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 ...
After ... (all text is now the same size)
I use six.text_type
instead of str
to respect precedent but also keep 2/3 compatibility.