File:Catagolue still life scatterplot b3s23 C1.png

From LifeWiki
Jump to navigation Jump to search

Original file(640 × 640 pixels, file size: 31 KB, MIME type: image/png)

Pattern Semilog scatterplot of still life counts vs. populations, based on Catagolue data for B3/S23/C1 from 2016-10-01. Generated using Python/numpy/matplotlib/statsmodels.

Script:

#!/usr/bin/python3

import numpy as np
import matplotlib.pyplot as plt
import statsmodels.api as sm

# read data file
datafile=open("xs_scatterplot.dat","rb")
x, y=np.loadtxt(datafile,delimiter="\t",skiprows=1,unpack=True)

# generate a scatter plot
fig, ax=plt.subplots()
ax.scatter(x, y, label='Count')
ax.set_yscale('symlog', linthreshy=1)
ax.set_xlabel('Population', fontsize=15)
ax.set_ylabel("Count", fontsize=15)
ax.set_title('Total still lifes by population', fontsize=20)
plt.ylim(ymin=0)
#plt.xlim(xmin=4)
ax.grid(True)
fig.tight_layout()

# plot linear fit
logy=np.log(y)
coefficients=np.polyfit(x, logy, 1)
polynomial=np.poly1d(coefficients)
ys=polynomial(x)
plt.plot(x, np.exp(ys), label='Linear fit')

# plot LOWESS fit
lowess=sm.nonparametric.lowess
z=lowess(logy, x, frac=0.3, it=3, return_sorted=False)
plt.plot(x, np.exp(z), label=r'LOWESS fit, $\alpha=0.3$')

# add legend
plt.legend(loc='upper right')

# save plot to file
fig.set_size_inches(8, 8)
plt.savefig("xs_scatterplot.png", dpi=80)

Input data:

Population	Count
4	59226634956040
5	8300152601291
6	36287875579390
7	9589041751021
8	1831061627671
9	9752130654
10	6648614605
11	1966944907
12	296645053864
13	250781922
14	113637861417
15	672983961
16	4250963305
17	223747639
18	799747551
19	28055058
20	100004321
21	2322435
22	14770842
23	722422
24	651844
25	333072
26	226630
27	48939
28	4663087
29	14302
30	69920
31	27084
32	11145
33	290
34	458
35	40
36	82
37	11
38	608
39	8
40	8048
41	2
42	102
45	1
46	1
56	1
Date 2017-01-06
Made by User:Apple Bottom
License
Heckert GNU white 64.png Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.

This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.

CC some rights reserved 90.png
Cc-by new white 24.png Cc-sa white 24.png

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current13:34, 15 July 2017Thumbnail for version as of 13:34, 15 July 2017640 × 640 (31 KB)Apple Bottom (talk | contribs)Regenerated from 2017-07-15 data
13:17, 8 January 2017Thumbnail for version as of 13:17, 8 January 2017640 × 640 (34 KB)Apple Bottom (talk | contribs)Updated from 2017-01-06 data
10:54, 18 November 2016Thumbnail for version as of 10:54, 18 November 2016640 × 640 (34 KB)Apple Bottom (talk | contribs)Updated from 2016-11-17 data
22:28, 4 October 2016Thumbnail for version as of 22:28, 4 October 2016640 × 640 (35 KB)Apple Bottom (talk | contribs)Regenerated from 2016-10-01 data.
18:31, 10 September 2016Thumbnail for version as of 18:31, 10 September 2016640 × 640 (34 KB)Apple Bottom (talk | contribs)Regenerated from 2016-09-10 data
11:44, 4 September 2016Thumbnail for version as of 11:44, 4 September 2016640 × 640 (34 KB)Apple Bottom (talk | contribs)Regenerated from 2016-09-04 data
15:46, 12 August 2016Thumbnail for version as of 15:46, 12 August 2016640 × 640 (34 KB)Apple Bottom (talk | contribs)Regenerated from 2016-08-12 data
22:43, 28 July 2016Thumbnail for version as of 22:43, 28 July 2016640 × 640 (33 KB)Apple Bottom (talk | contribs){{AppleBottomImage|patternnolink=Semilog scatterplot of still life counts vs. populations, based on Catagolue data for B3/S23/C1 from 2016-07-28. Generated using Python/numpy/matplotlib/statsmodels.|date=2016-07-28}}

The following page uses this file:

Metadata