Skip to content
Advertisement

How to get rid of the grey top and right line in Altair?

I was trying to visualise a result of linear regression. And I wanted to remove the top and right grey line. I have tried setting stroke=None, strokeWidth=0 and strokeOpacity=0 in global config but none of these worked. How can I get rid of them? Here’s my code and plot.

JavaScript

enter image description here

Advertisement

Answer

If you remove the last chart.show() or do chart = chart.configure_view(stroke=None) it will work. Currently you are not saving the modified chart.configure_view(stroke=None) back to the chart variable, and your last line displays the original chart variable without any modification to the stroke.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement