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

hvplot.image ignores data_aspect when responsive is True #1283

Closed
1 task
yt87 opened this issue Feb 20, 2024 · 3 comments
Closed
1 task

hvplot.image ignores data_aspect when responsive is True #1283

yt87 opened this issue Feb 20, 2024 · 3 comments

Comments

@yt87
Copy link

yt87 commented Feb 20, 2024

ALL software version info

python                    3.11.7          hab00c5b_1_cpython    conda-forge
xarray                    2024.1.1           pyhd8ed1ab_0    conda-forge
bokeh                     3.3.4              pyhd8ed1ab_0    conda-forge
holoviews                 1.18.2             pyhd8ed1ab_0    conda-forge
panel                     1.3.8              pyhd8ed1ab_0    conda-forge
hvplot                    0.9.2              pyhd8ed1ab_0    conda-forge

Description of expected behavior and the observed behavior

Cannot ensure that image aspect is preserved in a Panel app. In the code below, the first 2 images are displayed correctly (there is a warning that explains why responsive is ignored). The third one fills all remaining space in the browser, silently ignoring data_aspect=1.

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

import panel as pn
import numpy as np
import xarray as xr
import hvplot.xarray

a = np.array([[1, 0, 1], [0, 1, 0]])
da = xr.DataArray(a, name='a')
plt1 = da.hvplot.image(frame_width=800, data_aspect=1)
plt2 = da.hvplot.image(frame_width=800, data_aspect=1, responsive=True)
plt3 = da.hvplot.image(data_aspect=1, responsive=True)
pn.Column(plt1, plt2, plt3).servable()

Stack traceback and/or browser JavaScript console output

panel serve mean_extent.py --autoreload
2024-02-20 19:46:18,938 Starting Bokeh server version 3.3.4 (running on Tornado 6.3.3)
2024-02-20 19:46:18,938 User authentication hooks NOT provided (default user enabled)
2024-02-20 19:46:18,939 Bokeh app running at: http://localhost:5006/bar
2024-02-20 19:46:18,939 Starting Bokeh server with process id: 518955
2024-02-20 19:46:35,709 WebSocket connection opened
2024-02-20 19:46:35,709 ServerConnection created
. . . 
WARNING:param.RasterPlot01994: responsive mode could not be enabled because fixed width and aspect were specified.
2024-02-20 20:18:21,995 responsive mode could not be enabled because fixed width and aspect were specified.
2024-02-20 20:18:22,055 W-1005 (FIXED_SIZING_MODE): 'fixed' sizing mode requires width and height to be set: figure(id='p2154', ...)
2024-02-20 20:18:22,055 W-1005 (FIXED_SIZING_MODE): 'fixed' sizing mode requires width and height to be set: figure(id='p2095', ...)

Screenshots or screencasts of the bug in action

plt

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

droumis commented Feb 20, 2024

Likely same/similar issue as holoviz/panel#5343 and holoviz/panel#5054

@hoxbro
Copy link
Member

hoxbro commented Feb 21, 2024

Thank you for the bug report.

I agree with @droumis. It is a duplicate of holoviz/panel#5054.

@hoxbro hoxbro closed this as completed Feb 21, 2024
@yt87
Copy link
Author

yt87 commented Feb 21, 2024 via email

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