---
title: "matplotlib-python 画图-转-已测试"
author: "cuityang"
date: "2016-12-06T21:22:25Z"
tags: []
categories: ["编程语言"]
slug: "matplotlib-python"
draft: false
lastmod: "2016-12-06T21:22:25Z"
id: 2343243
url: "https://cuityang.iteye.com/blog/2343243"
---

import numpy as np
import matplotlib.pyplot as plt
plt.figure(1) 
plt.figure(2) 
ax1 = plt.subplot(211) 
ax2 = plt.subplot(212) 
x = np.linspace(0, 3, 100)
for i in xrange(5):
    plt.figure(1)  
    plt.plot(x, np.exp(i*x/3))
    plt.sca(ax1)   
    plt.plot(x, np.sin(i*x))
    plt.sca(ax2)  
    plt.plot(x, np.cos(i*x))
plt.show()