文章目录 Line Plot One figure, a set of subplots Image 展示图片 展示二元正态分布 A sample image Interpolating images 插值图像? Clip path Contouring and Pseudocolor 轮廓与伪彩色 Histograms hist() Paths Three-dimensional plotting Streamplot 流线图? Ellipses 椭圆 Bar charts 条形图 Pie c…
#!/usr/bin/env python #coding=GBK from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.gca(pro…
本文记录matlibplot常用基本操作,都是基本功能,不涉及复杂联合操作,其中各用法详细用法可参考官网: 1. 基本画图操作 ##mofan_matplotlib.pyplot import matplotlib.pyplot as plt import numpy as np x = np.linspace(1,50) y = 2*x + 1 #draw the lines #plt.plot(x,y) #show to draw the figure :must call at the l…
import matplotlib.pyplot as plt plt.scatter([1,2,3,4],[2,3,2,5])plt.title('My first plot')plt.show() import numpy as npimport pandas as pdimport matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3D x = np.arange(-2*np.pi,2*np.pi,0.1)y = np…
2D图形 import numpy as np import pandas as pd from pandas import Series,DataFrame import matplotlib.pyplot as plt 散点图 [散点图需要两个参数x,y,但此时x不是表示x轴的刻度,而是每个点的横坐标!] scatter() 通过散点图 可以研究 两个特征之间的关系 x = np.random.normal(loc=0,scale=5,size=1000) y = np.random.nor…
import math import numpy as np import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties from mpl_toolkits.mplot3d import Axes3D font = FontProperties(fname=r"c:\windows\fonts\simsun.ttc", size=12) # 设置字体 # 极坐标绘图 r = np.…