Skip to content
Advertisement

Tag: matplotlib

Plot multiple boxplot in one graph in pandas or matplotlib?

I have a two boxplotes But I want to place them in one graph to compare them. Have you any advice to solve this problem? Thanks! Answer Use return_type=’axes’ to get a1.boxplot to return a matplotlib Axes object. Then pass that axes to the second call to boxplot using ax=ax. This will cause both boxplots to be drawn on the

Align matplotlib scatter marker left and or right

I am using the matplotlib scatterplot function to create the appearance of handles on vertical lines to delineate certain parts of a graph. However, in order to make them look correct, I need to be able to align the scatter plot marker to the left (for the left line / delineator) and / or right (for the right line /

pyplot combine multiple line labels in legend

I have data that results in multiple lines being plotted, I want to give these lines a single label in my legend. I think this can be better demonstrated using the example below, As you can see at Out[23] the plot resulted in 5 distinct lines. The resulting plot looks like this Is there any way that I can tell

How to format axis number format to thousands with a comma

How can I change the format of the numbers in the x-axis to be like 10,000 instead of 10000? Ideally, I would just like to do something like this: Here is the code: Answer Use , as format specifier: Alternatively you can also use str.format instead of format: With matplotlib.ticker.FuncFormatter:

Setting plot background colour in Seaborn

I am using Seaborn to plot some data in Pandas. I am making some very large plots (factorplots). To see them, I am using some visualisation facilities at my university. I am using a Compound screen made up of 4 by 4 monitors with small (but nonzero) bevel — the gap between the screens. This gap is black. To minimise

Move and resize legends-box in matplotlib

I’m creating plots using Matplotlib that I save as SVG, export to .pdf + .pdf_tex using Inkscape, and include the .pdf_tex-file in a LaTeX document. This means that I can input LaTeX-commands in titles, legends etc., giving an image like this which renders like this when I use it in my LaTeX document. Notice that the font for the numbers

Plot histogram with colors taken from colormap

I want to plot a simple 1D histogram where the bars should follow the color-coding of a given colormap. Here’s an MWE: which outputs this: Instead of the color being green for the entire histogram, I’d like the columns to follow a color-coding given by the colormap defined in cm and the values of the bins. This would mean that

Advertisement