holoviz / holoviews

With Holoviews, your data visualizes itself.
https://holoviews.org
BSD 3-Clause "New" or "Revised" License
2.67k stars 400 forks source link

Correct (/control) spacing in layout #6311

Open arafune opened 2 weeks ago

arafune commented 2 weeks ago

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

https://holoviews.org/gallery/demos/bokeh/mandelbrot_section.html

The output of the code shown in the above webpage is same as on my Mac. I would like to control the space between two rows of the figures.

For me, the space is too wide, I would like to change it. Actually my own problem is same. I would like to change the spacing between two plots using .col(1).

Here is my own code:

import holoviews as hv import xarray as xr from holoviews import opts, streams hv.extension("bokeh")

def crosshair_view2(dataarray: xr.DataArray) -> None: """Show Crosshair view."""

# Create two images
posx = hv.streams.PointerX(x=0)
posy = hv.streams.PointerY(y=0)
vline = hv.DynamicMap(lambda x: hv.VLine(x or -100), streams=[posx])
hline = hv.DynamicMap(lambda y: hv.HLine(y or -100), streams=[posy])
img = hv.Image(dataarray, kdims=list(dataarray.dims))
profile_x = hv.DynamicMap(lambda x: img.sample(**{dataarray.dims[0]: x if x else 0}), streams=[posx])
profile_y = hv.DynamicMap(lambda y: hv.Curve(dataarray.sel({dataarray.dims[1]: y if y else 0}, method = "nearest")), streams=[posy])
return  (img * hline * vline + profile_y).cols(1)
arafune commented 2 weeks ago

On my Mac, the result show like this:

スクリーンショット 2024-07-08 13 41 44
maximlt commented 2 weeks ago

I get this view when I run the code in https://holoviews.org/gallery/demos/bokeh/mandelbrot_section.html.

image

I was no able to run your code, it is incomplete. Please provide more details as your issue is unclear to me.

arafune commented 2 weeks ago

After several tests, I have found that this problem originates from the web browser (safari). Bokeh does not seem to work correctly on the safari. You can close this issue. But I believe it would be more better for the very beginner (like me) to recommend to use the firefox or chrome to avoid such problem in the documents. Ryuichi Arafune

2024年7月8日(月) 16:33 Maxime Liquet @.***>:

I get this view when I run the code in https://holoviews.org/gallery/demos/bokeh/mandelbrot_section.html.

image.png (view on web) https://github.com/holoviz/holoviews/assets/35924738/35aeda7d-fd5c-4751-aac5-ce8aa6b9f986

I was no able to run your code, it is incomplete. Please provide more details as your issue is unclear to me.

— Reply to this email directly, view it on GitHub https://github.com/holoviz/holoviews/issues/6311#issuecomment-2213244671, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTRD5GY65JTCI7LRBMM2S3ZLI6DPAVCNFSM6AAAAABKQBIX66VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJTGI2DINRXGE . You are receiving this because you authored the thread.Message ID: @.***>

arafune commented 1 week ago

need more info?