[BUG] Log axis exponents react differently when font size is defined in anything but px (e.g. pt) · Issue #11006 · bokeh/bokeh · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was excited to see 2.3.0 starts to include exponents for large numbers. However, it seems a bit buggy, in that it works if you define your font size in "px" but not in "pt" or any other units so far as I can tell.
from bokeh.plotting import figure, output_file, show
x = [0.1, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0]
y = [10**xx for xx in x]
output_file("log.html")
# create a new plot with a log axis type
p = figure(plot_width=400, plot_height=400, y_axis_type="log")
p.line(x, y, line_width=2)
p.circle(x, y, fill_color="white", size=8)
p.axis.major_label_text_font_size = "20px"
show(p)
Using "20px" works as expected:
Using a font size of "20pt" instead causes the exponents to have the same font size as the base numbers, which looks wrong and takes up way more space.
Digging into the code, it seems like you theoretically accept font sizes in these units:
Theoretically, but only absolute units will work reliably (at some point we may get back to PR #10259 that adds support for relative units). So, pt should work, but the new implementation of log axis labels works only with px. It assumes that normalization to px units happens before this, but that doesn't actually happen.
Hi,
I was excited to see 2.3.0 starts to include exponents for large numbers. However, it seems a bit buggy, in that it works if you define your font size in "px" but not in "pt" or any other units so far as I can tell.
Taking the doc's log axis example, I just add a single line setting a custom font size.
Using
"20px"
works as expected:Using a font size of
"20pt"
instead causes the exponents to have the same font size as the base numbers, which looks wrong and takes up way more space.Digging into the code, it seems like you theoretically accept font sizes in these units:
and using any other of those units aside from
px
causes the same problem.The text was updated successfully, but these errors were encountered: