ESCI 386 Scientific Programming, Analysis and ...
嚜激SCI 386 每 Scientific Programming,
Analysis and Visualization with
Python
Lesson 13 - 2D Plots
1
Contour Plots
? Contour plots are created using the
contour() pyplot function or axes method.
? The only required argument is a 2-D array of
values, z.
每 plt.contour(z)
2
Basic Contour Example
import matplotlib.pyplot as plt
import numpy as np
z = np.load('heights.npy')
plt.contour(np.transpose(z))
plt.show()
? Note: We used transpose(z) because NumPy stores arrays in
[row, column] format whereas this data set assumes [column, row]
每 Keep this in mind if your plots display as rotated.
? &heights.npy* is in the &\\cyclone2\shared\ESCI 386* directory.
File: contour-basic.py
3
Basic Contour Result
4
Contour Plots
? Optional arrays x and y can specify the locations
of the z values.
每 plt.contour(x,y,z)
? The arrays x and y must also be 2-D arrays of the
same shape as z, or must be 1-D arrays where x
has the same length as the first dimension of z
and y has the same length as the second
dimension of z.
每 Including the arrays x and y allows irregularly spaced
data to be contoured.
5
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- data visualization
- matplotlib 2d and 3d plotting in python
- shape analysis measurement purdue university
- images and resampling simpleitk
- programming principles in python csci 503
- data structures in python grapenthin
- algorithms part ii partitioning and divide conquer
- python lists arrays and data frames
- introduction chapter to numpy
- introduction to python
Related searches
- scientific trivia questions and answers
- scientific method vocabulary and definitions
- java programming problems and solutions
- programming languages and their uses
- best scientific programming languages
- scientific programming language
- scientific programming languages ranking
- scientific programming journal
- scientific method steps and definitions
- scientific notation rules and examples
- java programming questions and answers
- programming symbols and their meaning