<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Palettable
Find Palettable online
Step1:  Palettable API
Step2:  Setting the matplotlib Color Cycle
Adapted from the example at http
Step3:  Using a Continuous Palette
Adapted from http
<ASSISTANT_TASK:>
Python Code:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
Explanation: Palettable
Find Palettable online:
Docs: https://jiffyclub.github.io/palettable/
GitHub: https://github.com/jiffyclub/palettable
PyPI: https://pypi.python.org/pypi/palettable/
End of explanation
from palettable.colorbrewer.qualitative import Set1_9
Set1_9.name
Set1_9.type
Set1_9.number
Set1_9.colors
Set1_9.hex_colors
Set1_9.mpl_colors
Set1_9.mpl_colormap
# requires ipythonblocks
Set1_9.show_as_blocks()
Set1_9.show_continuous_image()
Set1_9.show_discrete_image()
Explanation: Palettable API
End of explanation
from palettable.wesanderson import Aquatic1_5, Moonrise4_5
x = np.linspace(0, 2 * np.pi)
offsets = np.linspace(0, 2*np.pi, 4, endpoint=False)
# Create array with shifted-sine curve along each column
yy = np.transpose([np.sin(x + phi) for phi in offsets])
plt.rc('lines', linewidth=4)
plt.rc('axes', color_cycle=Aquatic1_5.mpl_colors)
fig, (ax0, ax1)  = plt.subplots(nrows=2)
ax0.plot(yy)
ax0.set_title('Set default color cycle to Aquatic1_5')
ax1.set_color_cycle(Moonrise4_5.mpl_colors)
ax1.plot(yy)
ax1.set_title('Set axes color cycle to Moonrise4_5')
# Tweak spacing between subplots to prevent labels from overlapping
plt.subplots_adjust(hspace=0.3)
Explanation: Setting the matplotlib Color Cycle
Adapted from the example at http://matplotlib.org/examples/color/color_cycle_demo.html.
Use the .mpl_colors attribute to change the color cycle used by matplotlib
when colors for plots are not specified.
End of explanation
from palettable.colorbrewer.sequential import YlGnBu_9
from matplotlib.colors import LogNorm
#normal distribution center at x=0 and y=5
x = np.random.randn(100000)
y = np.random.randn(100000)+5
plt.hist2d(x, y, bins=40, norm=LogNorm(), cmap=YlGnBu_9.mpl_colormap)
plt.colorbar()
Explanation: Using a Continuous Palette
Adapted from http://matplotlib.org/examples/pylab_examples/hist2d_log_demo.html.
Use the .mpl_colormap attribute any place you need a matplotlib colormap.
End of explanation
<END_TASK>