Skip to content

Issue with responsive plots using image #1074

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

Open
robertjwilson opened this issue Jun 1, 2023 · 2 comments
Open

Issue with responsive plots using image #1074

robertjwilson opened this issue Jun 1, 2023 · 2 comments

Comments

@robertjwilson
Copy link

Generating a responsive plot with image appears to not work since panel was updated to version 1.0.0. I'm aiming to open a plot in my web browser, which will responsively fill the screen. However, the update to panel (and also the change in the dependent version of bokeh) seems to have broken the ability of image to do this.

I'm working on Fedora 33, and the issue was initially raised to me by someone using my nctoolkit package on macOS M1.

The code below should reproduce the problem on all 1.0.x versions of panel. Instead of filling the web browser the plot gets squashed.

import xarray as xr
from threading import Thread
import hvplot.xarray
import hvplot as hv
import panel as pn
from bokeh.plotting import show

import hvplot.xarray  

hv.extension("bokeh")
hv.Store.renderers

import nctoolkit as nc

ds = xr.tutorial.open_dataset('air_temperature').load()

def ctrc():
    """
    A basic control to send a message to the terminal
    """
    print("Press Ctrl+C to stop plotting server")


intplot = ds.hvplot.image("lon", "lat", "air", 
        dynamic = True, 
        rasterize = False,
        responsive = True
        )


t = Thread(target=ctrc)
t.start()
bokeh_server = pn.panel(intplot, sizing_mode="stretch_both").show(
    threaded=False
)


If I run this using the latest version of panel I get a squashed plot that cannot be read.

hvplot

However, it is fine in panel version 0.14.4.

panel014

@philippjfr
Copy link
Member

I've already got the required updates in a branch, will push those up tomorrow and then get a 0.8.4 release out asap.

@robertjwilson
Copy link
Author

Excellent, @philippjfr . Keep up the good work.

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