![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
matplotlib
Marina-ju
虽恼太迟,又庆幸终于找到了喜欢的事
展开
-
matplotlib:次坐标轴ax2=ax1.twinx()
import numpy as npimport matplotlibmatplotlib.use(“TkAgg”)import matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3Dimport matplotlib.gridspec as gridspecx=np.arange(0,10,0.1)y1=0.0...原创 2019-01-17 10:02:12 · 10986 阅读 · 1 评论 -
matplotlib:plt.imshow
原创 2019-01-17 07:41:46 · 360 阅读 · 0 评论 -
matplotlib:plot 3d ,plot_surface
原创 2019-01-17 07:44:50 · 2453 阅读 · 0 评论 -
matplotlib:plt.subplot2grid,画子图
import numpy as npimport matplotlibmatplotlib.use(“TkAgg”)import matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3Dimport matplotlib.gridspec as gridspec#method 1:subplot2gridplt.f...原创 2019-01-17 08:17:21 · 4891 阅读 · 1 评论 -
matplotlib:gridspec.GridSpec()
import numpy as npimport matplotlibmatplotlib.use(“TkAgg”)import matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3Dimport matplotlib.gridspec as gridspecplt.figure()gs=gridspec.Gri...转载 2019-01-17 09:26:12 · 10748 阅读 · 0 评论 -
matplotlib:plt.subplots
import numpy as npimport matplotlibmatplotlib.use(“TkAgg”)import matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3Dimport matplotlib.gridspec as gridspecf,ax=plt.subplots(2,2,sharex...原创 2019-01-17 09:32:37 · 578 阅读 · 0 评论 -
matplotlib:图中图
原视频链接:https://www.bilibili.com/video/av16378354/?p=17import numpy as npimport matplotlibmatplotlib.use(“TkAgg”)import matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3Dimport matplo...原创 2019-01-17 09:53:23 · 1245 阅读 · 0 评论 -
matplotlibz中颜色与其对应的值
cnames = {‘aliceblue’: ‘#F0F8FF’,‘antiquewhite’: ‘#FAEBD7’,‘aqua’: ‘#00FFFF’,‘aquamarine’: ‘#7FFFD4’,‘azure’: ‘#F0FFFF’,‘beige’: ...转载 2019-03-16 16:06:23 · 784 阅读 · 0 评论 -
matplotlib:plt.contourf(画等高线)
import numpy as npimport matplotlibmatplotlib.use(“TkAgg”)import matplotlib.pyplot as pltdef height(x,y):#the height functionreturn(1-x/2+x5+y3)*np.exp(-x2-y2)n=256x=np.linspace(-3,3,n)y=np.l...转载 2019-01-16 22:03:09 · 10474 阅读 · 1 评论 -
matplotlib:animation动画
原视频链接:https://www.bilibili.com/video/av16378354/?p=19import numpy as npimport matplotlibmatplotlib.use(“TkAgg”)import matplotlib.pyplot as pltfrom matplotlib import animationfig,ax=plt.subplots(...转载 2019-01-17 10:37:52 · 805 阅读 · 0 评论 -
从tushare中提取股票交易数据并进行聚类分析
import numpy as npimport pandas as pdimport tushare as tsimport MySQLdb as mdbimport matplotlibmatplotlib.use(“TkAgg”)import matplotlib.pyplot as pltfrom matplotlib.collections import LineColle...原创 2019-01-22 08:20:27 · 7764 阅读 · 2 评论 -
matplotlib中文不显示问题的解决办法
from matplotlib.font_manager import FontPropertiesplt.figure()plt.title(‘中文’fontproperties=FontProperties(fname=’/System/Library/Fonts/PingFang.ttc’))转载 2019-01-22 09:03:05 · 1479 阅读 · 0 评论 -
maplotlib画图并修改坐标
import numpy as npimport matplotlibmatplotlib.use(“TkAgg”)import matplotlib.pyplot as pltx=np.linspace(-1,1,50)y1=3*x+1y2=x**2plt.figure()plt.plot(x,y1)plt.figure(num=3,figsize=(8,6))plt.plo...原创 2019-01-16 17:23:59 · 468 阅读 · 0 评论 -
matplot.legend
import numpy as npimport matplotlibmatplotlib.use(“TkAgg”)import matplotlib.pyplot as pltfrom matplotlib.collections import LineCollectionx=np.linspace(-1,1,50)y1=3*x+1y2=x**2l1,=plt.plot(x,y2...原创 2019-01-16 18:20:33 · 298 阅读 · 0 评论 -
matplotlib:plt.annotate
import numpy as npimport matplotlibmatplotlib.use(“TkAgg”)import matplotlib.pyplot as pltfrom matplotlib.collections import LineCollectionx=np.linspace(-1,1,50)y1=3*x+1y2=x**2plt.figure(num=3,...原创 2019-01-16 19:10:02 · 1413 阅读 · 0 评论 -
调整tick能见度
import numpy as npimport matplotlibmatplotlib.use(“TkAgg”)import matplotlib.pyplot as pltx=np.linspace(-3,3,50)y=0.2*xplt.figure()plt.plot(x,y,linewidth=10)plt.ylim(-2,2)ax=plt.gca()ax.spine...原创 2019-01-16 20:03:30 · 188 阅读 · 0 评论 -
matplotlib:plt.scatter
import numpy as npimport matplotlibmatplotlib.use(“TkAgg”)import matplotlib.pyplot as pltn=1024X=np.random.normal(0,1,n)Y=np.random.normal(0,1,n)T=np.arctan2(Y,X) # for color valueplt.scatter(...转载 2019-01-16 20:21:58 · 335 阅读 · 0 评论 -
matplotlib:plt.bar
import numpy as npimport matplotlibmatplotlib.use(“TkAgg”)import matplotlib.pyplot as pltn=12X=np.arange(n)Y1=(1-X/float(n))*np.random.uniform(0.5,1.0,n)Y2=(1-X/float(n))*np.random.uniform(0.5,...转载 2019-01-16 21:38:36 · 830 阅读 · 0 评论 -
matlibplot显示中文,显示正负号的设置
plt.rcParams[‘font.sans-serif’]=[‘SimHei’]plt.rcParams[‘axes.unicode_minus’]=False转载 2019-04-14 10:34:49 · 1539 阅读 · 0 评论