<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Using the colormap package
You can use the class Colormap as shown below
You can use the cmap_builder function and test_cmap function as well (see end of notebook)
Step1:  Well, I have not found the one I wanted...I wanted from red to white to green
Step2:  Using cma_builder and test_cmap
Instead of using the Colormap class, you can also use the cmap_builder alias function andthe test_cmap function
<ASSISTANT_TASK:>
Python Code:
%pylab inline
from colormap import Colormap
c = Colormap()
cmap = c.cmap('cool')
# let us see what it looks like
c.test_colormap(cmap)
#Would be nice to plot a bunch of colormap to pick up one interesting
c.plot_colormap('diverging')
c.plot_colormap(c.misc)
c.plot_colormap(c.qualitative)
c.plot_colormap(c.sequentials)
c.plot_colormap(c.sequentials2)
# This list is implemented in colormap package itself
c.plot_colormap(c.diverging_black)
Explanation: Using the colormap package
You can use the class Colormap as shown below
You can use the cmap_builder function and test_cmap function as well (see end of notebook)
End of explanation
mycmap = c.cmap_linear('red', 'white', 'green(w3c)')
c.test_colormap(mycmap)
mycmap = c.cmap_bicolor('red', 'green(w3c)')
c.test_colormap(mycmap)
# there is also 2 extra maps from R
mycmap = c.get_cmap_heat()
c.test_colormap(mycmap)
# color can be given a a name available in 
import colormap.xfree86 as colors
list(colors.XFree86_colors.keys())[0:5]
#or 
list(colors.XFree86_colors.values())[0:5]
# or as RGB, HLS, HSV, YUX, Hexa format
from colormap import Color
co = Color('white')
co.hex
mycmap = c.cmap_linear('red', '#FFFFFF', 'green(w3c)')
c.test_colormap(mycmap)
# Conversion between colors
c = Color('red')
c.rgb
c.hls
c.hex
print(c)
Explanation: Well, I have not found the one I wanted...I wanted from red to white to green
End of explanation
from colormap import cmap_builder, test_cmap
mycm = cmap_builder('red', 'white', 'green')
test_cmap(mycm)
Explanation: Using cma_builder and test_cmap
Instead of using the Colormap class, you can also use the cmap_builder alias function andthe test_cmap function
End of explanation
<END_TASK>