0

I'm trying to plot a barplot with transactionmode, gender and transaction amount.

The code is below

transaction = df_['tran_amt (k$)_sum']
print(transaction)

The output is

0   26664155.670
1   32688205.040
2   24929334.070
3   15192023.230
4   16591676.100
5   15464572.750
6   49061770.320
7   19451150.150
Name: tran_amt (k$)_sum, dtype: float64

The code for seaborn barplot is below

plt.figure(figsize=(10,8))

sns.barplot(x="transaction_mode", y=transaction.values, hue="gender", data=df_, palette="Set2")

the output is below

enter image description here

As you can see in the image, on the y axis i can't see the transaction values, it's just showing 0, 1, 2, 3, 4, 5. How to get the transaction values? How to resolve this issue?

Mark
  • 331
  • 2
  • 10
  • 3
    Note the 1e7 at the top. The y-axis is in scientific notation. See this link for how to disable it: [prevent scientific notation in matplotlib.pyplot](https://stackoverflow.com/questions/28371674/prevent-scientific-notation-in-matplotlib-pyplot) – tdy Mar 22 '22 at 08:39
  • 1
    Note that you can save the axes handle from your barplot like `ax = sns.barplot(...)` – tdy Mar 22 '22 at 08:41

0 Answers0