matplotlib
DarrenXf
这个作者很懒,什么都没留下…
展开
-
matplotlib 展示numpy图像
matplotlib 显示numpy图像显示图像#!/usr/bin/python# -*- coding: utf-8 -*-###################################### File name : plt_img.py# Create date : 2021-09-04 17:14# Modified date : 2021-09-04 23:36# Author : DARREN# Describe : not set# Email : lzygzh@原创 2021-09-05 00:04:39 · 7406 阅读 · 0 评论 -
No module named 'matplotlib.finance'
解决 No module named ‘matplotlib.finance’import matplotlib.finance as mpf然后使用mpf.candlestick_ochl出现上面的问题。出现这个问题的原因是在使用的matplotlib版本中, finance 库已经被剔除了。需要使用的话,就得安装。安装finance 库pip install -i http...原创 2019-06-30 18:14:15 · 6449 阅读 · 0 评论 -
pip安装错误 Beginning with Matplotlib 3.1, Python 3.6 or above is required
pip 安装matplotlib 没有能成功,打印出错误Beginning with Matplotlib 3.1, Python 3.6 or above is required原因本地环境是python 3.6以下的版本。解决如果不升python 版本的话, 降低要安装的matplotlib版本。出现这个问题,安装的版本应该是matplotlib 3.1试着降低版本pip in...原创 2019-06-30 13:04:42 · 6213 阅读 · 1 评论 -
Python matplotlib 概率论与数理统计 伯努利分布 二项分布
Python 代码实现 二项分布import numpy as npimport matplotlib.pyplot as plt import mathfrom scipy import statsn = 100 p = 0.05k = np.arange(0,n)binomial = stats.binom.pmf(k,n,p)plt.plot(k,binomial,'...原创 2018-10-01 01:11:33 · 1028 阅读 · 0 评论 -
Python matplotlib pylab 画张图
from pylab import *w1 = 1 w2 = 25fs = 18y = np.arange(-2,2,0.001)x = w1*y*log(y)-1.0/w2*exp(-(w2*y-w2/exp(1))**4)plt.title(u'DARREN DRAW NAIZI')plt.xlabel(u'x')plt.ylabel(u'y')plt.axis([-1....原创 2018-09-14 10:58:57 · 696 阅读 · 5 评论 -
Python matplotlib pylot和pylab的区别
matplotlib是Python中强大的绘图库。matplotlib下pyplot和pylab均可以绘图。具体来说两者的区别pyplot 方便快速绘制matplotlib通过pyplot模块提供了一套和MATLAB类似的绘图API,将众多绘图对象构成的复杂结构隐藏在这套API内部。pylab 包括了许多Numpy和pyplot模块中常用的函数,方便用户快速进行计算和绘图,十分适合...原创 2018-09-14 10:58:48 · 1627 阅读 · 0 评论 -
Ubuntu matplotlib animation save 保存 使用 例子
animation_demo.py"""================pyplot animation================Generating an animation by calling `~.pyplot.pause` between plotting commands.The method shown here is only suitable for s...原创 2018-09-06 14:54:01 · 2083 阅读 · 0 评论 -
Python Numpy matplotlib Histograms 直方图
import numpy as npimport matplotlib.pyplot as plt mu,sigma = 2,0.5v = np.random.normal(mu,sigma,10000)plt.hist(v,bins=50,density=1)plt.show()import numpy as npimport matplotlib.pyplot as p...原创 2018-09-13 13:26:48 · 1191 阅读 · 0 评论 -
Python matplotlib numpy 曼德尔布罗特集合 曼德尔布罗特 B.Madelbrot
import numpy as npimport matplotlib.pyplot as plt def mandelbrot(h,w,maxit=20): y,x = np.ogrid[-1.4:1.4:h*1j,-2:0.8:w*1j] c = x+y*1j z = c divtime = maxit + np.zeros(z.shape,dtype=...原创 2018-09-13 13:26:42 · 1621 阅读 · 0 评论 -
matplotlib animation 动画 使用
import numpy as npimport matplotlib.pyplot as plt from matplotlib.animation import FuncAnimationfig, ax = plt.subplots()xdata,ydata = [],[]ln, = ax.plot([],[],'r-',animated=False)def init():...原创 2018-09-05 23:09:38 · 1857 阅读 · 0 评论 -
matplotlib 使用
import numpy as npimport matplotlib.pyplot as plt x = np.linspace(-1,1,10)y = 2*x+1plt.plot(x,y)plt.show()python 运行得到下面的结果import matplotlib.pyplot as plt import numpy as npx = np.lin...原创 2018-09-05 14:28:43 · 511 阅读 · 0 评论