Skip to content
Advertisement

How do I overlay multiple sns distplots or change the colour based on a secondary variable using a pandas df

I have a pandas dataframe with a ‘frequency_mhz’ variable and a ‘type’ variable. I want to create a dist plot using seaborne that overlays all of the frequencys but changes the colour based on the ‘type’.

JavaScript

seaborne dist plots

Is there a way I can overlay the 3 into one plot? or a way ive missed to change the colour of the bars based on another variable as you can with ‘hue=’ in other plots?

Advertisement

Answer

You can specify ax as kwarg to superimpose your plots:

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