Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Matplotlib 2.x

You're reading from   Mastering Matplotlib 2.x Effective Data Visualization techniques with Python

Arrow left icon
Product type Paperback
Published in Nov 2018
Publisher Packt
ISBN-13 9781789617696
Length 214 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Benjamin Walter Keller Benjamin Walter Keller
Author Profile Icon Benjamin Walter Keller
Benjamin Walter Keller
Arrow right icon
View More author details
Toc

Non-Cartesian plots

We will begin by importing all the necessary packages, as follows:

import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline
# Set up figure size and DPI for screen demo
plt.rcParams['figure.figsize'] = (6,4)
plt.rcParams['figure.dpi'] = 150

Creating polar axes

First, we will bring up a simple plot with the following code:

nums = np.arange(0,10,0.1)
plt.plot(nums, nums/10.)
plt.plot(nums, np.sin(nums))
plt.plot(nums, np.cos(nums))

The preceding code will give the following output:

The preceding output shows a sine and cosine plot, with a linear plot alongside it. We will take a look at the cosine and sine plot, but not as a function of its linear length....

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image