proplot-dev / proplot

🎨 A succinct matplotlib wrapper for making beautiful, publication-quality graphics
https://proplot.readthedocs.io
MIT License
1.11k stars 102 forks source link

boxpctiles does not draw boxes #382

Closed AWSisco closed 1 year ago

AWSisco commented 2 years ago

Description

I think there's a minor bug when adding on-the-fly box plots to scatter, line, and bar charts. boxpctile works as expected, but the equivalent boxpctiles has no effect.

Steps to reproduce

import proplot as pplt
import numpy as np
import pandas as pd

data = np.full((100,10),fill_value=np.nan)  

np.random.seed(1999)
mu = np.random.randint(10,21,10)
sigma = np.random.randint(1,5,10)

for i in range(0,10):
    data[:,i] = np.random.normal(mu[i],sigma[i],100)

data = pd.DataFrame(data)

fig, axs = pplt.subplots(ncols=2, aspect=(1.5,1))

axs[0].bar(data, medians=True, barpctile=(5,95), boxpctile=True, ec='k', c='yellow5')
axs[1].bar(data, medians=True, barpctile=(5,95), boxpctiles=True, ec='k', c='yellow5') #No boxes appear here

boxes

Proplot version

matplotlib=3.5.2 proplot=0.9.5.post332

lukelbd commented 1 year ago

Thanks for the report. This was indeed a bug -- just a typo (fixed by f6cc8b9). New result:

import proplot as pplt
import numpy as np
import pandas as pd

data = np.full((100,10),fill_value=np.nan)  

np.random.seed(1999)
mu = np.random.randint(10,21,10)
sigma = np.random.randint(1,5,10)

for i in range(0,10):
    data[:,i] = np.random.normal(mu[i],sigma[i],100)

data = pd.DataFrame(data)

fig, axs = pplt.subplots(ncols=2, aspect=(1.5,1))

axs[0].bar(data, medians=True, barpctile=(5,95), boxpctile=True, ec='k', c='yellow5')
axs[1].bar(data, medians=True, barpctile=(5,95), boxpctiles=True, ec='k', c='yellow5') #No boxes appear her

iTerm2 RcTj0Y tmphy23eujc