You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to make boxplot with custom colors as in this example from matplotlib: https://matplotlib.org/3.1.1/gallery/statistics/boxplot_color.html, however, it looks like we don't have access to .set_facecolor from a bplot['boxes'] with proplot and/or the argument fillcolor doesn't take list.
Steps to reproduce
Expected behavior:
Here is the matplotlib example (from the link above, a bit modified):
importmatplotlib.pyplotaspltimportnumpyasnp# Random test datanp.random.seed(19680801)
all_data= [np.random.normal(0, std, size=100) forstdinrange(1, 4)]
labels= ['x1', 'x2', 'x3']
fig, ax=plt.subplots()
# rectangular box plotbplot=ax.boxplot(all_data, patch_artist=True, labels=labels)
ax.set_title('Rectangular box plot')
# fill with colorscolors= ['pink', 'lightblue', 'lightgreen']
forpatch, colorinzip(bplot['boxes'], colors):
patch.set_facecolor(color)
# adding horizontal grid linesax.yaxis.grid(True)
ax.set_xlabel('Three separate samples')
ax.set_ylabel('Observed values')
plt.show()
Actual behavior:
Same with Proplot, I've just transformed the data in pandas DataFrame (I guess it's needed for Proplot?):
Description
I would like to make boxplot with custom colors as in this example from matplotlib: https://matplotlib.org/3.1.1/gallery/statistics/boxplot_color.html, however, it looks like we don't have access to
.set_facecolor
from abplot['boxes']
with proplot and/or the argumentfillcolor
doesn't take list.Steps to reproduce
Expected behavior:
Here is the matplotlib example (from the link above, a bit modified):
Actual behavior:
Same with Proplot, I've just transformed the data in pandas DataFrame (I guess it's needed for Proplot?):
Returns:
AttributeError: 'Line2D' object has no attribute 'set_facecolor'
So I don't know if there is another way, I tried to pass a list to the fill
fillcolor
option from Proplot (as in this example: https://proplot.readthedocs.io/en/latest/1dplots.html#Box-plots-and-violin-plots), however it didn't work too.Thanks before for the help if I missed something.
Proplot version
0.6.4
The text was updated successfully, but these errors were encountered: