Matplotlib.

Slides:



Advertisements
Similar presentations
Python: Your new best friend print “Adam Avison”.
Advertisements

Computation for Physics 計算物理概論
Introduction to Engineering MATLAB – 11 Plotting - 4 Agenda Multiple curves Multiple plot.
2D Plots 1 ENGR 1181 MATLAB 12.
Physics-Informatics Looking for Higgs Particle Counting Errors (Continued) January Geoffrey Fox
Recitation 7 Programming for Engineers in Python.
EGR106 Week 6 MATLAB FILES Two Dimensional Plots Multiple Plots
EGR106 Week 4 Two Dimensional Plots Multiple Plots Plot Formatting Homework.
Python plotting for lab folk Only the stuff you need to know to make publishable figures of your data. For all else: ask Sourish.
Python Crash Course Plotting 3 rd year Bachelors V1.0 dd Hour 1.
PYTHON PLOTTING CURVES CHAPTER 10_5 FROM THINK PYTHON HOW TO THINK LIKE A COMPUTER SCIENTIST.
 1 Basic Data Visualization. IPython An interactive shell to execute Python script. Run from a shell; ipython 2.
IMAGE PROCESSING LIBRARY (PIL) This is a package that you can import into python and it has quite a few methods that you can process image files with.
Steven Christe 1,, Matt Earnshaw 2, Keith Hughitt 1, Jack Ireland 1, Florian Mayer 3, Albert Shih 1, Alex Young 1 1 NASA GSFC 2 Imperial College London.
Chapter 5 Review: Plotting Introduction to MATLAB 7 Engineering 161.
MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago
418512: Computer Programming Languages Lecture 7 Pramook Khungurn TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
Introduction to Python By Neil Cook Twitter: njcuk Slides/Notes:
Introduction to Biostatistics and Bioinformatics Exploring Data and Descriptive Statistics.
Visualization UW CSE 140 Winter matplotlib Strives to emulate MATLAB – Pro: familiar to MATLAB users – Pro: powerful – Con: not the best design.
Introduction to Programming Workshop 6 PHYS1101 Discovery Skills in Physics Dr. Nigel Dipper Room 125d
Scientific Python Numpy Linear Algebra Matrices Scipy Signal Processing Optimization IPython Interactive Console Matplotlib Plotting Sympy Symbolic Math.
Matplotlib A python 2D plotting library  Publication quality figures in several hardcopy formats and interactive environments.
1-d Arrays & Plotting.
Python Crash Course Numpy & MatplotLib Sterrenkundig Practicum 2 V1.0 dd Hour 3.
1 Lecture 5 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Matplotlib SANTHOSH Boggarapu.
Python & NetworkX Youn-Hee Han
MATLAB ® for Engineers, Holly Moore Fourth Edition, Global Edition © Pearson Education Limited 2015 All rights reserved. Figure 5.1 Simple Plot of Time.
Python Lab Matplotlib - I Proteomics Informatics, Spring 2014 Week 9 25 th Mar, 2014
Using Python to Retrieve and Visualize Data (part 1 of 2) Jon Goodall Hydroinformatics Fall 2014 This work was funded by National Science Foundation Grants.
Copyright © CRS Enterprises Ltd 1 Python for Scientists by Chris Seddon.
CS 5163 Introduction to Data Science
How To Draw Well in Paper
Numerical and Scientific Computing Part 2
Lecture 8: Python Writing Scripts in GIS
Lecture 25.
Project 1 Part E3 Programming PicoScope ---Looping--
IPYTHON AND MATPLOTLIB Python for computational science
Lecture 25: Exploring data
Two-Dimensional Plots
Python for Quant Finance
Python NumPy AILab Batselem Jagvaral 2016 March.
CSC 1315! Data Science Lecture 18.
Marine and Coastal Biodiversity Management in Pacific Island Countries
Visualization UW CSE 160 Spring 2018.
Machine Learning in Python Scikit-learn 2 Prof. Muhammad Saeed.
Topics read length distribution genome coverage
PYTHON Prof. Muhammad Saeed.
Pete Alonzi University of Virginia Library Research Data Services
Visualization UW CSE 160 Winter 2016.
MatLab – 2D Plots 2 MATLAB has many built-in functions and commands to create various types of plots. Instructor notes: We start with an example of some.
Python plotting curves chapter 10_5
Visualization UW CSE 160 Winter 2017.
Tutorial 2 SEG7550 Introduction to MATLAB II
Plotting Multiple Graphs In The Same Plot
Advanced Plotting Techniques
Interpolation and curve fitting
Notes on pyplot Professor Hugh C. Lauer CS-1004 — Introduction to Programming for Non-Majors (Slides include materials from Python Programming: An Introduction.
雲端計算.
PYTHON Graphs Prof. Muhammad Saeed.
Plotting Signals in MATLAB
雲端計算.
Visualization UW CSE 160 Spring 2015.
Matplotlib and Pandas
Programming with data Lab 3
Simulate Multiple Dice
Jingbo Yang, Andrey Kurenkov
Presentation transcript:

matplotlib

matplotlib

matplotlib matplotlib is a python 2D plotting library which produces publicatio quality figures in a variety of hardcopy http://matplotlib.sourceforge.net/

Simple Plot. The most basic plot(), with text labels matplotlib Simple Plot. The most basic plot(), with text labels import matplotlib.pyplot as plt plt.plot([1,2,3,4])‏ plt.ylabel('some numbers')‏ plt.show()‏

matplotlib plot() is a versatile command, and will take an arbitrary number of arguments. For example, to plot x versus y, you can issue the command: plt.plot([1,2,3,4], [1,4,9,16])‏ there is an optional third argument which is the format string that indicates the color and line type of the plot.

matplotlib import matplotlib.pyplot as plt plt.plot([1,2,3,4], [1,4,9,16], 'ro')‏ plt.axis([0, 6, 0, 20])‏ plt.show()‏

matplotlib import matplotlib.pyplot as plt t= [float(x)/10.0 for x in range(0,50,2)] t2=[x**2 for x in t] t3=[x**3 for x in t] plt.plot(t,t,'r--', t,t2,'bs', t,t3,'g^')‏ plt.show()‏

Working with multiple figures and axes Matplotlib: Working with multiple figures and axes import matplotlib.pyplot as plt plt.figure(1) # the first figure plt.subplot(211) # the first subplot in the first figure plt.plot([1,2,3])‏ plt.subplot(212) # the second subplot in the first figure plt.plot([4,5,6])‏ plt.figure(2) # a second figure plt.plot([4,5,6]) # creates a subplot(111) by default plt.figure(1) # figure 1 current; subplot(212) still current plt.subplot(211) # make subplot(211) in figure1 current plt.title('Easy as 1,2,3') # subplot 211 title plt.show()‏

Matplotlib: working with text import numpy as np import matplotlib.pyplot as plt mu, sigma = 100, 15 x = mu + sigma * np.random.randn(10000)‏ # the histogram of the data n, bins, patches = plt.hist(x, 50, normed=1, facecolor='g', alpha=0.75)‏ plt.xlabel('Smarts')‏ plt.ylabel('Probability')‏ plt.title('Histogram of IQ')‏ plt.text(60,.025, r'$\mu=100,\ \sigma=15$')‏ plt.axis([40, 160, 0, 0.03])‏ plt.grid(True)‏ plt.show()‏