0

I have a data-frame of the following format with 4977 rows x 227 columns, the last column is 'STDEV'

 data = {'TCTN':['101', '102', '103', '104'], '0':[626, 866, 1, 474] , '1':[485,182,290,1367], '2':[1985,555,626,8], 'STDEV':[5911,6040,5974,6062]} 

i created a scatter plot between values of 'TCTN' column and 'STDEV' column i.e, standard deviation of all columns corresponding to specific TCTN numbers :

p=plt.scatter(df3['STDEV'].values, df3['TCTN'].values)

scatter plot

i wanted to increase the figsize of the plot to make the data-points more distinct using:

p=plt.scatter(df3['STDEV'].values, df3['TCTN'].values,figsize=(10,10))

but i get AttributeError: 'PathCollection' object has no property 'figsize'

Also, i want to expand the x-axis between values 5000-70000 so that i can try to fit a regression curve of some sort in it.Please help me out

Devarshi Goswami
  • 1,035
  • 4
  • 11
  • 26
  • Does this answer your question? [How do you change the size of figures drawn with matplotlib?](https://stackoverflow.com/questions/332289/how-do-you-change-the-size-of-figures-drawn-with-matplotlib) – Bart Jan 23 '20 at 07:43

1 Answers1

1

For the size, you can add this line:

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

Full code:

plt.figure(figsize=(10, 10))
plt.xlim(5000,7000)
p=plt.scatter(df3['STDEV'].values, df3['TCTN'].values)

Although it is not totally clear to me if you meant this with expand the x-axis between 5000-7000

Joe
  • 12,057
  • 5
  • 39
  • 55
  • This does increase the figsize of my plot but the datapoints are still not legible , i.e There still exists this huge overlapping column of datapoints in the '6000' mark. Do i try some other plot? – Devarshi Goswami Jan 23 '20 at 09:18
  • You can stretch a bit with `plt.xlim(5800,6200)` – Joe Jan 23 '20 at 09:56