问题
I am trying to remove the border from an altair chart.
This answer works perfectly but it fails when I try to visualize a layered chart.
In my setting I have two charts, one for the contour m1
and one with the coordinates assigned to each category and properly colored m2
.
I can add the setting configure_view(strokeWidth=0)
to each and I can plot them independently, however when trying to plot m1+m2
I get an error.
Objects with "config" attribute cannot be used within LayerChart. Consider defining the config attribute in the LayerChart object instead.
I then defined m1
and m2
without the config_view
attribute but now I can't figure out how to define it for the final object.
回答1:
Apparently it is as simple as creating a new object and setting the attribute on that object.
layeredmap=m1+m2
layeredmap.configure_view(strokedWidth=0)
Alternatively, it is enough to use parenthesis and define the attribute while plotting:
(m1+m2).configure_view(strokedWidth=0)
来源:https://stackoverflow.com/questions/59028248/altair-remove-border-in-layerchart