<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 <img style='float
Step1:  Connect to server
Step2:  <hr> Simple matrix
Matrices are useful ways to visualize dense tables and correlation matrices data.
<br>
First we show a random matrix with default styles.
<br>
You can us the arrow keys to change the contrast (up/down) or the colormap (left/right).
Step3:  <hr> Different shapes
Rectanglular matrices will automatically size appropriately.
Step4:  <hr> Colors
Matrices can be rendered using any colorbrewer colormaps.
Step5:  <hr> Labels
You can label the rows and columns of a matrix. Clicking on the text labels will highlight those rows and columns -- try it!
Step6:  You can also turn on labeling of cells by their value.
<ASSISTANT_TASK:>
Python Code:
from lightning import Lightning
from numpy import random, arange, asarray, corrcoef, argsort, array
import networkx as nx
from sklearn import datasets
Explanation: <img style='float: left' src="http://lightning-viz.github.io/images/logo.png"> <br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Matrix plots in <a href='http://lightning-viz.github.io/'><font color='#9175f0'>Lightning</font></a>
<hr> Setup
End of explanation
lgn = Lightning(ipython=True, host='http://public.lightning-viz.org')
Explanation: Connect to server
End of explanation
mat = random.randn(10,10)
lgn.matrix(mat)
Explanation: <hr> Simple matrix
Matrices are useful ways to visualize dense tables and correlation matrices data.
<br>
First we show a random matrix with default styles.
<br>
You can us the arrow keys to change the contrast (up/down) or the colormap (left/right).
End of explanation
mat = random.randn(10,20)
lgn.matrix(mat)
mat = random.randn(20,10)
lgn.matrix(mat)
Explanation: <hr> Different shapes
Rectanglular matrices will automatically size appropriately.
End of explanation
mat = random.rand(10,10)
lgn.matrix(mat, colormap='Reds')
mat = random.rand(10,10)
lgn.matrix(mat, colormap='Spectral')
Explanation: <hr> Colors
Matrices can be rendered using any colorbrewer colormaps.
End of explanation
n, m = (8, 16)
mat = arange(n*m).reshape(n,m)
rows = ['row ' + str(i) for i in range(n)]
columns = ['col ' + str(i) for i in range(m)]
lgn.matrix(mat, row_labels=rows, column_labels=columns)
Explanation: <hr> Labels
You can label the rows and columns of a matrix. Clicking on the text labels will highlight those rows and columns -- try it!
End of explanation
mat = arange(n*m).reshape(n,m)
lgn.matrix(mat, numbers=True)
Explanation: You can also turn on labeling of cells by their value.
End of explanation
<END_TASK>