In [1]:
print 'This is my notebook'


This is my notebook

In [1]:
import json
with open('SplinedataDES_all_18000') as dat:
    DESdata = json.load(dat)

In [38]:
import random
count = 0
id_tmp = 0
objdata = {}
random.shuffle(DESdata)
for entry in DESdata:
    if count != 0 and id_tmp != entry['id']:
        if len(objdata) == 5:
            break
    count += 1
    if count == 40:
        break
    if entry['band'] == 'r':
        id_tmp = entry['id']
        objdata['rydata'] = entry['spldata_sampled']
        objdata['xdata'] = entry['mjddata_sampled']
    else:
        objdata['{}ydata'.format(entry['band'])] = entry['spldata_sampled']

In [61]:
%matplotlib
import numpy as np


Using matplotlib backend: TkAgg

In [60]:
%matplotlib
import matplotlib.pyplot as plt

t = np.array(objdata['xdata'])
y0 = np.array(objdata['gydata']) 
y1 = objdata['rydata']
y2 = objdata['iydata']
y3 = objdata['zydata']

fig = plt.figure(figsize = (12,12))
ax0 = fig.add_subplot(414)
ax0.plot(t, y0)
plt.setp(ax0.get_xticklabels(), fontsize = 12)


#axt.set_xlabel('Phase (days)')
#axt.set_ylabel('Normalized Flux')



ax1 = fig.add_subplot(413, sharex = ax0)
ax1.plot(t, y1)
plt.setp( ax1.get_xticklabels(), visible=False)


ax2 = fig.add_subplot(412, sharex = ax0)
ax2.plot(t, y2)
plt.setp( ax2.get_xticklabels(), visible=False)

ax3 = fig.add_subplot(411, sharex = ax0)
ax3.plot(t, y3)
plt.setp( ax3.get_xticklabels(), visible=False)


plt.show()


Using matplotlib backend: TkAgg

In [32]:
from pylab import *

t = arange(0.01, 5.0, 0.01)
s1 = sin(2*pi*t)
s2 = exp(-t)
s3 = sin(4*pi*t)
ax1 = subplot(311)
plot(t,s1)
setp( ax1.get_xticklabels(), fontsize=6)

## share x only
ax2 = subplot(312, sharex=ax1)
plot(t, s2)
# make these tick labels invisible
setp( ax2.get_xticklabels(), visible=False)

# share x and y
ax3 = subplot(313,  sharex=ax1, sharey=ax1)
plot(t, s3)
xlim(0.01,5.0)
show()



In [ ]: