User Tools

Site Tools


simple_faceting_matplotlib

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

simple_faceting_matplotlib [2016/11/25 12:38] (current)
vincenzo created
Line 1: Line 1:
 +This include the label rotation and shading through the parameter "​rot="​. ​
 +
 +<code python>
 +import matplotlib
 +matplotlib.style.use('​ggplot'​)
 +import matplotlib.pyplot as plt
 +import pandas as pd
 +
 +df = pd.DataFrame({ '​celltype':​["​foo","​bar","​qux","​woz"​],​ '​s1':​[5,​9,​1,​7],​ '​s2':​[12,​90,​13,​87]})
 +df = df[["​celltype","​s1","​s2"​]]
 +df.set_index(["​celltype"​],​inplace=True)
 +df.plot(kind='​bar',​alpha=0.75,​ rot=0)
 +plt.xlabel(""​)
 +plt.show()
 +</​code>​
 +
  
simple_faceting_matplotlib.txt ยท Last modified: 2016/11/25 12:38 by vincenzo