In [1]:
%matplotlib inline
import numpy as np
import scipy as sp
import matplotlib as mpl
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import pandas as pd
pd.set_option('display.width', 500)
pd.set_option('display.max_columns', 100)
pd.set_option('display.notebook_repr_html', True)
import seaborn as sns
sns.set_style("whitegrid")
sns.set_context("poster")


/Users/hzabriskie/Documents/Music21/anaconda/lib/python2.7/site-packages/matplotlib/__init__.py:872: UserWarning: axes.color_cycle is deprecated and replaced with axes.prop_cycle; please use the latter.
  warnings.warn(self.msg_depr % (key, alt_key))

In [47]:
N = 5
GAP = 2
indices = np.arange(N)
colors = sns.diverging_palette(220, 20, n=5)
width = 1. / (N + GAP)
hfont = {'fontname':'Helvetica'}
fig, ax = plt.subplots(figsize=(15,6))
lg_vals = [58.29, 56.09, 67.06, 8.22, 36.33]
ax.bar(indices, lg_vals, width, color=colors[0], label='Root')
nb_vals = [48.19, 50.43, 62.66, 34.73, 31.65]
ax.bar(indices + width, nb_vals, width, color=colors[1], label='Base')
rf_vals = [63.71, 59.72, 69.73, 47.22, 46.81]
ax.bar(indices + width * 2, rf_vals, width, color=colors[2], label='Inversion')
mccf_train_vals = [28.5, 49.5, 63.9, 22.6, 20.3]
ax.bar(indices + width * 3, mccf_train_vals, width, color=colors[3], label='MCCF - Training')
mccf_test_vals = [28.5, 49.5, 63.9, 22.6, 20.3]
ax.bar(indices + width * 4, mccf_test_vals, width, color=colors[4], label='MCCF - Test')

# Text
ax.set_xticks(indices + width * N / 2)
ax.set_xlim([-0.5, 5.5])
ax.set_ylim([0, 100])
ax.legend(loc='upper right')
plt.show()



In [33]:
x = sns.diverging_palette(220, 20, n=7)

In [34]:
x[0]


Out[34]:
array([ 0.24715576,  0.49918708,  0.57655991,  1.        ])

In [48]:
csfont = {'fontname':'Comic Sans MS'}
hfont = {'fontname':'Helvetica'}
# plt.title('title',**csfont)
# plt.xlabel('xlabel', **hfont)


  File "<ipython-input-48-e35b46c14b5a>", line 3
    **csfont
     ^
SyntaxError: invalid syntax

In [ ]: