Plotting in Python
Matplotlib is a Python 2D plotting library which produces publication quality figures.
You can generate plots, histograms, power spectra, bar charts, errorcharts, scatterplots, etc, with just a few lines of code.
Check the link for more details: http://matplotlib.org/
Use the following line to allow the plots to be displayed as part of the jupyter notebook:
Plotting
Add a second line to the plot. Try to use different line colors, markers and linestyles.
Check the link for plotting: http://matplotlib.org/users/pyplot_tutorial.html
Line Plots: Exercise
Histograms
To make histograms, let us first create some data which is normally distributed.
To create a histogram use hist() function of matplotlib.pyplot
Plotting: Exercise
Exercise 1
Create 2 random DNA sequences (random_seq1 and random_seq2) of length 500.
Use your own dna_tools module to count nucleotide usage (A,T,G, and C) in seq_r1 and seq_r2.
Make a line plot to display the nucleotide usage.
Use different markers for different sequences.
Exercise 2:
Generate 100 random DNA sequences of length 500.
Plot a histogram for 'A' nucleotide usage in the 100 random DNA sequences.
Add histograms of other nucleotide usage in the same histogram.