Altair remove border in LayerChart

感情迁移 提交于 2019-12-24 23:06:04

问题


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 m2without 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!