In [1]:
import os
os.chdir('/Users/Tony/Documents/Git Folder/seelviz/Jupyter/DownsampleGraphML')

from argparse import ArgumentParser
from collections import OrderedDict
from subprocess import Popen
from scipy.stats import gaussian_kde
from matplotlib.backends.backend_pdf import PdfPages

import numpy as np
import nibabel as nb
import networkx as nx
import os
import pickle
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab

import random

In [2]:
x = random.uniform(0, 1)
print x


0.458981151759

In [7]:
xhist = (np.random.rand(5000, 1))
print xhist


[[ 0.58984995]
 [ 0.95935512]
 [ 0.33090203]
 ..., 
 [ 0.35773899]
 [ 0.28649891]
 [ 0.10661699]]

In [14]:
pp = PdfPages('test.pdf')

num_bins = 50
# the histogram of the data
# n, bins, patches = plt.hist(xhist, num_bins, facecolor='green', alpha=0.5)

plt.axis([0, 1, 0, 1000])
plt.xlabel('Values')
plt.ylabel('Counts')
plt.title(r'Histogram of Values vs Counts')

# Tweak spacing to prevent clipping of ylabel
plt.subplots_adjust(left=0.15)
pp.savefig()
pp.close()

In [ ]: