installing the matplotlib via pip in the enviroment dos
Posted hugeng007
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了installing the matplotlib via pip in the enviroment dos相关的知识,希望对你有一定的参考价值。
目录
一、The installing of matplotlib
matplotlib is matrix plotting library.
pip installing matlotlib
二、The Result Of Installing
The Unknown Word
The First Column The Second Column matrix 矩阵[metriks] plotting 测绘,标图 plotting library 绘图库
三、Histogram
The Numpy histogram function applied to an array returns a pair of vectors:the histogram of the array and the vector of bins.Beware:matloblib also has a function to build histogram.(called hist
,as in Matlab)that differs from the one in NumPy.The main difference is that pylab.hist
plots the histogram automatically,while numpy.histogram only generate the data.
import numpy as np
import matplotlib.pyplot as plt
# Build a vector of 10000 normal deviates with variance 0.5^2 and mean 2
mu, sigma = 2, 0.5
v = np.random.normal(mu,sigma,10000)
# Plot a normalized histogram with 50 bins
plt.hist(v, bins=50, density=1) # matplotlib version (plot)
plt.show()
The result of first section:
# Compute the histogram with numpy and then plot it
(n, bins) = np.histogram(v, bins=50, density=True) # NumPy version (no plot)
plt.plot(.5*(bins[1:]+bins[:-1]), n)
plt.show()
The result of the second section:
以上是关于installing the matplotlib via pip in the enviroment dos的主要内容,如果未能解决你的问题,请参考以下文章
python安装matplotlib:python -m pip install matplotlib报错
matplotlib使用时报错RuntimeError: Python is not installed as a framework
Pip install matplotlib 在 M1 Mac 上失败
python使用matplotlib可视化线图(line plot)自定义可视化图像的背景色(change the background color of a plot in matplotlib)