I'm using pandas version 0.17.0 , matplotlib version 1.4.3 and seaborn version 0.6.0 to create a 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's the code I use to plot 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 being changed to exponential form in Python matplotlib figure, 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)
resulting in:
plt.gca().get_xaxis().get_major_formatter().set_useOffset(False)
AttributeError: 'FixedFormatter' object has no attribute 'set_useOffset'
Seaborn Boxplot documentation says, I can pass an Axes object to draw the plot onto. So I tried to create an axis with scientific notation 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 it?