<jupyter_start><jupyter_text>Sunspot Number Plot<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
data = np.loadtxt("sunspots.txt",float)
x = data[:,0]
y = data[:,1]

#Converting x to year
x2 = 1749+x/12.0
#Plot all data
plt.plot(x2, y, 'm-')
plt.title('Sunspot Number 1749-2011')
plt.ylim(-10,270)
plt.xlim(1749,2011)
plt.xlabel("Year")
plt.ylabel("Sunspot Number")
plt.grid()
#Plot 20 years of data (quick way)
plt.plot(x2, y, 'm-')
plt.title('Sunspot Number 1981-2011')
plt.ylim(-10,270)
plt.xlim(1981,2011)
plt.xlabel("Year")
plt.ylabel("Sunspot Number")
plt.grid()
#Plot 20 years of data and add Poisson counting errors. 
yerr = np.sqrt(y)
plt.errorbar(x2, y, yerr=yerr)
#plt.plot(x2, y, 'm-')
plt.title('Sunspot Number 1981-2011')
plt.ylim(-10,270)
plt.xlim(1981,2011)
plt.xlabel("Year")
plt.ylabel("Sunspot Number")
plt.grid()
#Plot 20 years of data with Poisson counting errors and overplot sine wave
yerr = np.sqrt(y)
plt.errorbar(x2, y, yerr=yerr)

#y=sin x has a period of 2*pi, amplitude one and goes through the origin
#y=A+Bsin(Cx + D) has amplitude B around y=A, has period 2pi/C and starts at A,D
y2=85.+80*np.sin(x2*2*np.pi/11.0+2.0)
#y3=85.+80*np.sin(x2*2*np.pi/11.0+2.0)
plt.plot(x2,y2,'m-')
#plt.plot(x2,y3,'r-')
plt.title('Sunspot Number 1991-2011')
plt.ylim(-10,270)
plt.xlim(1991,2011)
plt.xlabel("Year")
plt.ylabel("Sunspot Number")
plt.grid()<jupyter_output><empty_output><jupyter_text>Histogram<jupyter_code>import mpl_style
plt.style.use(mpl_style.style1)
# the histogram of the data
n, bins, patches = plt.hist(y, 50, normed=1, facecolor='m', alpha=0.75)

#alpha is a parameter which sets the saturation of the colour
#normed normalises the area to 1.  

plt.xlabel('Sunspot number')
plt.ylabel('Frequency')
plt.title('Histogram of Sunspot Number')

# This will put a text fragment at the position given:
#plt.text(55, .027, r'$\mu=100,\ \sigma=15$', fontsize=14)
#plt.axis([40, 160, 0, 0.03])
plt.grid(True)<jupyter_output><empty_output><jupyter_text>2D Plot of the Surface of Silicon<jupyter_code>data = np.loadtxt("stm.txt",float)
plt.imshow(data,origin="lower",cmap='viridis')
plt.title('The Surface of Silicon from a scanning tunneling microscope')
plt.colorbar(label='Height above surface')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1661591996520226, 'fraction_numerical': 0.07177033492822966, 'mean_word_length': 5.948640483383686, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '375445', 'license': 'Apache-2.0', 'n_tokens_mistral': 1089, 'n_tokens_neox': 927, 'n_words': 224, 'path': 'data/notebooks/nb_883750.ipynb', 'repo_name': 'DavidRV00/notebook-analysis', 'size': '2299'}