name grade chandler A joey B phoebe B monica C ross A rachel B mike C gunther A How to proceed from here if I want to make 8 different report cards (small graph in A4 size paper), and highlight the grade category in which the student belongs? Edit: I want to show gunther in which group he falls in.
Tag: seaborn
Sharing Y-axis in a matplotlib subplots
I have been trying to create a matplotlib subplot (1 x 3) with horizontal bar plots on either side of a lineplot. It looks like this: The code for generating the above plot – Edit How do I share the y-axis of the central line plot with the other horizontal bar plots? Answer I would set the limits of all
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
Plot group averages for each rating on 4 separate plots
I have 4 groups (research, sales, manu, hr) and each group has 2 categories (0 & 1). I am trying to plot the average scores for each group in the features in the list ratings. The code that gives me the means looks like this (with depts = [‘research’, ‘sales’, ‘manu’, ‘hr’]: Which results in this output: My question is
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
Set line widths according to column for seaborn FacetGrid with lineplot
I would like to pick out a certain line in each lineplot in a FacetGrid, to highlight the “default” setting compared to the other options. I’ve tried to make a minimal example based on this random walk example in the seaborn documentation This gives me faceted line plots with all lines the same width (of course): I have created an
How to plot data from multiple dataframes with seaborn relplot
I want to plot two lines on the same set of axes. It seems sns.relplot is creating a facetted figure, and I don’t know how to specify that I want the second line on the same facet as the first. Here’s a MWE How do I get the red and blue lines on the same plot? I’ve not had luck