Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scalebar text removed when plot included in Layout #6449

Closed
1 task
droumis opened this issue Nov 11, 2024 · 3 comments
Closed
1 task

Scalebar text removed when plot included in Layout #6449

droumis opened this issue Nov 11, 2024 · 3 comments

Comments

@droumis
Copy link
Member

droumis commented Nov 11, 2024

ALL software version info

Software Version Info
Python              :  3.12.4 | packaged by conda-forge | (main, Jun 17 2024, 10:13:44) [Clang 16.0.6 ]
Operating system    :  macOS-13.5.2-arm64-arm-64bit
Panel comms         :  default

holoviews           :  1.20.0

bokeh               :  3.6.1
colorcet            :  3.1.0
cudf                :  -
cupy                :  -
dask                :  2024.7.1
dask-expr           :  1.1.9
datashader          :  0.16.3
geoviews            :  -
hvplot              :  0.10.0
ibis-framework      :  -
IPython             :  8.26.0
ipywidgets-bokeh    :  -
jupyter-bokeh       :  -
jupyterlab          :  4.2.4
matplotlib          :  3.9.1
networkx            :  -
notebook            :  -
numba               :  0.60.0
numpy               :  2.0.0
pandas              :  2.2.2
panel               :  1.5.3
param               :  2.1.1
pillow              :  10.4.0
plotly              :  -
pyarrow             :  16.1.0
pyviz-comms         :  3.0.2
scikit-image        :  -
scipy               :  1.14.0
spatialpandas       :  -
streamz             :  -
tsdownsample        :  -
xarray              :  2024.6.0

Description of expected behavior and the observed behavior

Scalebar text removed when plot included in Layout

Complete, minimal, self-contained example code that reproduces the issue

import holoviews as hv
hv.extension('bokeh')
curve = hv.Curve([1,2]).opts(scalebar=True)
curve
curve + hv.Curve([2,1])

Stack traceback and/or browser JavaScript console output

Screenshots or screencasts of the bug in action

Image

  • I may be interested in making a pull request to address this
@hoxbro
Copy link
Member

hoxbro commented Nov 12, 2024

I think this and #6448 are problem in Bokeh (or a setting that we are not setting correctly).

A pure Bokeh example:

import numpy as np
from bokeh.layouts import column, row, gridplot
from bokeh.models import ColumnDataSource, Metric, RangeTool, ScaleBar
from bokeh.plotting import figure, show

n_points = 3000
x_values = np.linspace(0, 100, n_points)
y_values = np.random.randn(n_points).cumsum()


def plot(width, height, location="right"):
    source = ColumnDataSource(data=dict(x=x_values, y=y_values))

    p = figure(width=width, height=height)
    p.line("x", "y", source=source)
    p.toolbar_location = location

    scale_bar = ScaleBar(
        range=p.x_range, orientation="horizontal", location="bottom_right"
    )
    p.add_layout(scale_bar)
    return p

lay = row(plot(300, 300),  plot(800, 300))
show(lay)

lay = gridplot(children=[[plot(300, 300, "above"), plot(300, 300, "above")]])
show(lay)

Image

@mattpap, any thoughts?

@mattpap
Copy link

mattpap commented Nov 12, 2024

It seems completely broken. I'm investigating.

@mattpap
Copy link

mattpap commented Nov 12, 2024

Fixed and will be a part of bokeh 3.6.2.

@hoxbro hoxbro closed this as completed Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants