Style plot background not working properly
See original GitHub issueI am using holoviews with matplotlib and plotly backends.
import holoviews as hv
import numpy as np
from functools import reduce
hv.extension('plotly', 'matplotlib')
The problem is I specify bgcolor in the options of the final overlay. The final overlay is composed of many objects
The code i use to create the plot object looks like the following:
plot_obj = reduce(lambda x, y: x * y,
[
group.opts(hv.opts.Path3D(color=hv.Cycle(color_swatch)),
hv.opts.Scatter3D(color=hv.Cycle(color_swatch), size=10, marker='cross'))
for group in groups
] +
[
arrow.opts(hv.opts.Path3D(color='black'))
] +
[
prism_points.opts(hv.opts.Scatter3D(color=hv.Cycle(ms_color_swatch), size=4))
] +
[
unit_vectors.opts(hv.opts.Path3D(color='black'))
]
)
plot_obj.opts(width=900, height=600, aspect=aspect, bgcolor='lightgray')
The result is a plot with a white background. Something is weird.
print(plot_obj)
:Overlay
.Conductors.P1_c1_m0_m1 :Path3D [x,y,z]
.Conductors.P2_c1_m0_m1 :Path3D [x,y,z]
.Conductors.P3_c1_m0_m1 :Path3D [x,y,z]
.Conductors.P4_c2_m0_m1 :Path3D [x,y,z]
.Conductors.P5_c2_m0_m1 :Path3D [x,y,z]
.Conductors.P6_c2_m0_m1 :Path3D [x,y,z]
.Span_Points.I :Scatter3D [x,y,z]
.Span_Points.II :Scatter3D [x,y,z]
.Span_Points.III :Scatter3D [x,y,z]
.Span_Points.IV :Scatter3D [x,y,z]
.Span_Points.V :Scatter3D [x,y,z]
.Span_Points.VI :Scatter3D [x,y,z]
.Conductors.P1_c1_m1_m2 :Path3D [x,y,z]
.Conductors.P2_c1_m1_m2 :Path3D [x,y,z]
.Conductors.P3_c1_m1_m2 :Path3D [x,y,z]
.Conductors.P4_c2_m1_m2 :Path3D [x,y,z]
.Conductors.P5_c2_m1_m2 :Path3D [x,y,z]
.Conductors.P6_c2_m1_m2 :Path3D [x,y,z]
.Span_Points.VII :Scatter3D [x,y,z]
.Span_Points.VIII :Scatter3D [x,y,z]
.Span_Points.IX :Scatter3D [x,y,z]
.Span_Points.X :Scatter3D [x,y,z]
.Span_Points.XI :Scatter3D [x,y,z]
.Span_Points.XII :Scatter3D [x,y,z]
.Conductors.P1_c1_m2_m3 :Path3D [x,y,z]
.Conductors.P2_c1_m2_m3 :Path3D [x,y,z]
.Conductors.P3_c1_m2_m3 :Path3D [x,y,z]
.Conductors.P4_c2_m2_m3 :Path3D [x,y,z]
.Conductors.P5_c2_m2_m3 :Path3D [x,y,z]
.Conductors.P6_c2_m2_m3 :Path3D [x,y,z]
.Span_Points.XIII :Scatter3D [x,y,z]
.Span_Points.XIV :Scatter3D [x,y,z]
.Span_Points.XV :Scatter3D [x,y,z]
.Span_Points.XVI :Scatter3D [x,y,z]
.Span_Points.XVII :Scatter3D [x,y,z]
.Span_Points.XVIII :Scatter3D [x,y,z]
.Total_Station.I :Path3D [x,y,z]
.Device_Points.Ms1 :Scatter3D [x,y,z]
.Device_Points.Ms2 :Scatter3D [x,y,z]
.Unit_Vectors.I :Path3D [x,y,z]
.Unit_Vectors.II :Path3D [x,y,z]
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (8 by maintainers)
Top GitHub Comments
bgcolor
is a plot option in holoviews, so it should be handled consistently across backends, but is probably not implemented.I can’t reproduce any issue issue with 2D plots, the issue appears to be specific to plotly 3D plots.
@arabidopsis
bgcolor
controls the color of the background and the bottom layer takes precedence, if you want to color the boxes use color or fill_color.