Its logic is also a bit strange, as it creates a grid based on the number of columns you're plotting (the length of the first argument), but it only does this if you supply a by argument. When you only plot one value, it creates a 1-by-1 subplots grid, which isn't very useful. However, what it seems like it should do, but it doesn't, is check to see if you're only plotting one value, and in that case, use the provided ax object (if any) instead of making its own subplots. It apparently does this so that, if you want to plot more than one value, it will create subplots for each value (e.g., one boxplot for Y1 by day, another for Y2 by day, etc.). What is going on is that if you supply a by argument to boxplot, pandas issues its own subplots call, erasing any existing subplots. This appears to be a bug, or at least undesirable behavior, in the pandas plotting setup. So, I then tried supplying the axis by hand: plt.figure()īut this simply destroyed the subplot grid all together, as well as the initial image:Īny ideas how I can get my boxplot image to appear in the bottom right grid in the subplots (the one that's empty in the first set of images)? The first thing I've tried is the following: plt.figure()īut this simply creates the plot outside of the subplots: But I can't seem to draw it within the subplot grid. I'm having an issue drawing a Pandas boxplot within a subplot.īased on the two ways I'm trying, creating the boxplot either removes all the subplots that I've already created, or plots the boxplot after the subplot grid.
0 Comments
Leave a Reply. |