Prevent scientific notation in the sea box

I use pandas version 0.17.0, matplotlib version 1.4.3 and marine version 0.6.0 to create boxplot. I want all values ​​on the x axis in float notation. Currently, the two smallest values ​​(0.00001 and 0.00005) are formatted in scientific notation.

Here is the code I use to build the image:

import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

data = pd.read_csv("resultsFinal2.csv")

boxplot = sns.boxplot(x="Regularisierungsparameter", y="F1", data=data.sort("Regularisierungsparameter"))

plt.show()

As suggested in How to prevent numbers from changing exponentially in a Python matplotlib drawing , I tried:

boxplot = sns.boxplot(x="Regularisierungsparameter", y="F1", data=data.sort("Regularisierungsparameter"))
ax = plt.gca()
ax.get_xaxis().get_major_formatter().set_scientific(False)

as a result of:

    plt.gca().get_xaxis().get_major_formatter().set_useOffset(False)
AttributeError: 'FixedFormatter' object has no attribute 'set_useOffset'

Seaborn Boxplot documentation says that I can pass an Axes object to draw a plot. Therefore, I tried to create an axis with the scientific record disabled and passed it to sns.boxplot:

ax1 = plt.gca().get_xaxis().get_major_formatter().set_useOffset(False)
boxplot = sns.boxplot(x="Regularisierungsparameter", y="F1", data=data.sort("Regularisierungsparameter"), ax=ax1)

That didn't work either. Can someone tell me how to do this?

+1
1

, ,

fig, ax = plt.subplots(1, 1)
boxplot = sns.boxplot(x="Regularisierungsparameter", y="F1", data=data.sort("Regularisierungsparameter"), ax=ax)
labels = ['%.5f' % float(t.get_text()) for t in ax.get_xticklabels()]
ax.set_xticklabels(labels)
0

All Articles