0

I am trying to create subplots that capture the distribution of certain variables; I am using seaborn's distplot function to accomplish this. my problem is that I would like to suppress the scientific notation of my axes and have the values appear as regular numbers.

I have tried suppressing scientific notation both in my Dataframe:

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

f, axes = plt.subplots(3, 1, figsize=(12, 12))

sns.distplot(result['amount'], hist=True, ax=axes[0]) 
axes[0].set_title('Distribution of Transaction Amount')
axes[0].set_xlim(0, 100000) #----> This was my attempt

sns.distplot(result['oldbalanceDest'], hist=True, ax=axes[1])
axes[1].set_title('Distribution of Old Balance Destination Amounts')

sns.distplot(result['oldbalanceOrg'], hist=True, ax=axes[2])
axes[2].set_title('Distribution of Old Balance Origination Amounts')

plt.tight_layout()
#

I have also tried using the following two options to suppress the scientific notation once I import my dataset as a dataframe. This has been successful, however, when I tried to plot my subplots using the code above, the scientific notation persists.

pd.set_option('display.float_format', lambda x: '%.f' % x)
pd.set_option('precision',3)
maroulator
  • 129
  • 8
  • See if [this answer](https://stackoverflow.com/questions/53747298/how-to-format-seaborn-matplotlib-axis-tick-labels-from-number-to-thousands-or-mi) helps you. You should be able to use set_yticklabels() to set the labels to whatever you want. – caxcaxcoatl Sep 16 '19 at 05:26
  • By the way, a snapshot of the error would be very helpful as part of your question. Note that on Stack, you can just paste it from the clipboard, so it is really easy to do – caxcaxcoatl Sep 16 '19 at 05:28
  • Possible duplicate of [How to format seaborn/matplotlib axis tick labels from number to thousands or Millions? (125,436 to 125.4K)](https://stackoverflow.com/questions/53747298/how-to-format-seaborn-matplotlib-axis-tick-labels-from-number-to-thousands-or-mi) – caxcaxcoatl Sep 16 '19 at 05:33

0 Answers0