Skip to content
Advertisement

Tag: seaborn

Export huge seaborn chart into pdf with multiple pages

I created a program which generates a large number of chart using seaborn catplot. This is the example of my code with the illustration of how the final chart looks like. However since the plot may extend up to more than 300 plots, when I tried to export to pdf, the size of the chart is too big and big

X-axis out of order seaborn histplot

I am trying to create a seaborn histplot and am almost done, however, I noticed that my x-axis is out of order. Displays: Adding order argument as shown here creates the following error(s): How can I force that order on my x-axis? Answer You could create a bar plot, using np.histogram to count how many values are in each bin.

Change displot bar colors to a specific color

I am struggling to change my displot bar colours. I want to change the colour of the bars to the light blue colour on at the end of the palette (shown below). I have tried this, but the colour seems to remain as a dark blue, which is not what I want. How do I change the colours to a

How to plot simple moving averages with stock data

I am trying to plot simple moving averages (SMA) using Apple’s stock price. I have lines below: But the plotting isn’t successful. What did I do wrong, and how I can correct it? Answer From the code you posted, it seems as though you didn’t set the index of the dataframe after loading the data from the csv file. pd.read_csv

Sort categorical x-axis in a seaborn scatter plot

I am trying to plot the top 30 percent values in a data frame using a seaborn scatter plot as shown below. The reproducible code for the same plot: Here, I want sort the x-axis in order = [‘virginica’,’setosa’,’versicolor’]. When I tried to use order as one of the parameter in sns.scatterplot(), it returned an error AttributeError: ‘PathCollection’ object has

Advertisement