Python Forum
It doesn't show scatter plot but it says: "<Figure size 640x480 with 1 Axes>"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
It doesn't show scatter plot but it says: "<Figure size 640x480 with 1 Axes>"
#1
Hello everyone! I'm trying to run this code for getting a scatter plot with green dots but it doesn't show the plot. I really appreciate some help!

import pandas as pd
import matplotlib.pyplot as plt

#Reading sales data
sales_df=pd.read_csv('BigMartSalesData.csv')

#print(sales_df['InvoiceNo'])

#Grouping by Invoice Numbers to find the range with the highest concentration of amounts
Inv_am=sales_df.groupby('InvoiceNo').sum()['Amount']

#print(Inv_am.values)
plt.scatter(Inv_am.index, Inv_am.values, color='g')
plt.xlabel=('Invoice')
plt.ylabel=('Amount')
plt.title=('Amount in sales by Invoice')
plt.show()
Output:
<Figure size 640x480 with 1 Axes>
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to plot 2 graphs in one figure? man0s 1 1,336 Apr-25-2022, 09:18 AM
Last Post: Axel_Erfurt
  Matplotlib scatter plot in loop with None values ivan_sc 1 2,236 Nov-04-2021, 11:25 PM
Last Post: jefsummers
  Matplotlib scatter plot slider with datetime sonny 0 2,919 Feb-05-2021, 02:31 AM
Last Post: sonny
  matplotlib creating a scatter plot via PathCollection tpourjalali 0 2,430 Apr-11-2020, 05:59 PM
Last Post: tpourjalali
  Not able to figure out how to create bar plot on aggregate data - Python darpInd 1 2,253 Mar-30-2020, 11:37 AM
Last Post: jefsummers
  How to add lables to the scatter plot? Jack_Sparrow 3 3,224 Dec-11-2019, 10:20 PM
Last Post: Larz60+
  How to create correct scatter plot for PCA? LK91 0 2,070 Dec-11-2019, 07:53 PM
Last Post: LK91
  Dynamically placing axes in subplots via dataframe plot naftis 1 2,921 Jul-29-2019, 12:10 AM
Last Post: scidam
  How to plot data to the same figure for every run? chry5ler 3 4,678 Aug-03-2018, 04:21 PM
Last Post: heras

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020