un hardcoded dpi

This commit is contained in:
socks 2021-02-14 18:59:30 +00:00
parent 35fc806327
commit b30f90a002

View file

@ -32,15 +32,16 @@ def generate_table(headers, data, title="", bg='skyblue', border='steelblue'):
# seems to better regulate white space. Sometimes experimenting # seems to better regulate white space. Sometimes experimenting
# with an explicit figsize here can produce better outcome. # with an explicit figsize here can produce better outcome.
image_height = (( 0.9375 + ( 0.40625 * ( len(data) + 1) ) ) * 160) dpi = 160
image_width = 6 * 160 image_height = (( 0.9375 + ( 0.40625 * ( len(data) + 1) ) ) * dpi)
image_width = 6 * dpi
plt.figure(linewidth=2, plt.figure(linewidth=2,
edgecolor=fig_border, edgecolor=fig_border,
facecolor=fig_background_color, facecolor=fig_background_color,
tight_layout={'pad':1}, tight_layout={'pad':1},
dpi=160, dpi=dpi,
figsize=(image_width/160, image_height/160) figsize=(image_width/dpi, image_height/dpi)
) )
# Add a table at the bottom of the axes # Add a table at the bottom of the axes