Skip to content
Advertisement

Tag: altair

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. enter image description here Answer If you remove the last chart.show()

Drawing a closed loop with Altair mark_line without repeating data

See this example and this similar question. I also want to draw a closed loop with mark_line in Altair. However, I am currently in the process of streamlining my code to be more data-efficient, which is presenting a wrinkle that I am having trouble with. I have a dataset of x and y data that I plot as a scatterplot.

Altair combine two charts

I am trying to plot/combine two charts on Altair, but only one of the chart is actually showing with the expected data. The second chart doesn’t show. The second chart is blank Code below: Image below: Answer If life is referring to life expectancy, the reason you don’t see the lines is the lower facet is likely that the sum

Change bubble size in altair without changing font size

I am trying to create a altair bubble chart. The sample code and sample dataframe is below: I want the size of the bubble based on Market_cap and put names of companies alongside. The problem is font size of names is also changing as per the bubble size. How can this I create this bubble chart with different bubble size

Advertisement