pn.Row with two pn.pane.Panes showing an ipyvolume is shown in a column instead. How to fix?

I tried the following:

import ipyvolume as ipv
import numpy as np
N = 1000
x, y, z = np.random.normal(0, 1, (3, N))

fig = ipv.figure()
scatter = ipv.scatter(x, y, z)
pn.Row(pn.pane.Pane(ipv.show()),  pn.pane.Pane(ipv.show()))

it works, but the plots appear in a column, rather than in a row.
Anybody know how to get the layout to work?

BTW, to get ipyvolume to work with Jupyterlab 2.x.x requires some fiddling:
see https://github.com/maartenbreddels/ipyvolume/issues/324

Figured it out: I need to grab fig:

pn.Row(pn.pane.Pane(fig), pn.pane.Pane(fig) )
1 Like

I would do something like the below including importing the FontAwesome stylesheet.

import panel as pn
import ipyvolume as ipv
import numpy as np
FONTAWESOME_LINK = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.css"
pn.config.css_files.append(FONTAWESOME_LINK)

N = 1000
x, y, z = np.random.normal(0, 1, (3, N))

fig = ipv.figure()
scatter = ipv.scatter(x, y, z, color="#4464ad")
pn.Column(pn.pane.Markdown("## Panel meets IPyVolume"), pn.panel(fig, margin=50)).servable()
1 Like

I added a pythreejs autorotate control and put the result on gitlab at

@Marc what is the advantage of using fontawesome?

1 Like

Hi @ea42gh

Thanks for adding working examples back. That helps build the knowledge of our community.

Before adding the fontawesome fonts the icons like home in the menu of Ipyvolume where just shown as rectangles because the font was not available.

1 Like