leather icon indicating copy to clipboard operation
leather copied to clipboard

Use axis_title_font_size and tick_font_size.

Open Math-ias opened this issue 2 years ago • 0 comments

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.

Math-ias avatar May 09 '22 19:05 Math-ias