Stretched First Quartile
When notch is disabled no stretching
R output
sns.boxplot(
data=df_bergen,
x='result_DL',
y='grouping_1',
notch=True,
whis=2.5,
color=hdr_blue,
ax=axes[0],
orient='h'
)
axes[0].set_title("Box Plot for Specific Tributary")
axes[0].set_xlabel("Result DL")
axes[0].set_ylabel("Grouping")
axes[0].set_xlim(1, 250000)
axes[0].set_xscale('log')
plt.tight_layout()
plt.show()
I am verifying the results of a water quality report, it was decided that a 2.5x IQR multiplier for outliers was used instead of the default approximate 1.5x IQR. The formula for the notches is by default is median +/- 1.57 x IQR/sqrt(n) in seaborn, I don’t see a way to change this without going into the seaborn package and finding the formula for the notch width (which I have tried but could not locate).
I used the in R studio code (ggplot2) in the appendices of the report, and there is no stretching of the 1st quartile regardless of the notch width formula coefficient. The data tables produced by the R code and my python code is the same. The values and plots all correspond in my original graph and table with all of the other tributaries. There is nothing out of the ordinary for this tributary in terms of min, 25%, median and sample size compared to the other tributaries. Anyone have a clue as to why this is occurring? Some of the other tributaries have a small “flipped appearance” for the notches but no stretching output this ugly. Full plot with other Tributaries
Kiran O is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.