Basic Plotting

Getting Ready

Import packages

import numpy as np
from numpy.random import randn
import matplotlib.pyplot as plt
import pandas as pd
from pandas import Series, DataFrame,date_range
from matplotlib import cm

Read in data

dat=pd.read_csv("C:\\Users\duan\Desktop\PythonDataProcessingVisualization\metaDataMean.txt", sep='\s+')
dat

Line Plot

For list of named colors see herearrow-up-right

Change plotting style and add legend

Bar Plot

add a horizontal line

plot horizontal bars

Histogram Plot

Box Plot

Define a title

Boxplot by celltype

Better layout by excluding the automatic title

More sophisticated plotting can better reveal the trend

Last updated

Was this helpful?