如何在python中使用次要情节函数绘图

  介绍

这期内容当中小编将会给大家带来有关如何在python中使用次要情节函数绘图、文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。

python主要用来做什么

python主要应用于:1,网络开发;2、数据科学研究;3,网络爬虫;4、嵌入式应用开发,5日游戏开发;6桌面应用开发。

背景

使用python进行图像可视化,很多情况下都需要次要情节将多幅图像绘制在一个图中。因为使用频率足够高,那么程序员就需要将其“封装”,方便复用,所以,这里将笔者常用的次要情节用法记录之。

模板

,显示中文

plt.rcParams [& # 39; font.sans-serif& # 39;],=, (& # 39; SimHei& # 39;), #,显示中文

使用次要情节(221)

如何在python中使用次要情节函数绘图

对应的次要情节代码:

得到skimage  import 数据   得到matplotlib  import  pyplot  as  plt      时间=moon  data.moon ()   时间=camera  data.camera ()   时间=image_minus  moon 安康;相机   +=image_plus  moon 相机   #,绘图   plt.rcParams [& # 39; font.sans-serif& # 39;],=, (& # 39; SimHei& # 39;), #,显示中文      plt.subplot (2,, 2,, 1)   plt.title(& # 39;月亮图像& # 39;)   plt.imshow(月亮)      plt.subplot (2,, 2,, 2)   plt.title(& # 39;摄影师图像& # 39;)   plt.imshow(相机)      plt.subplot (2,, 2,, 3)   plt.title(& # 39;月亮加摄影师图像& # 39;)   plt.imshow (image_plus)      plt.subplot (2, 2, 4)   plt.title(& # 39;月亮减摄影师图像& # 39;)   plt.imshow (image_minus)      plt.tight_layout ()   plt.show ()

使用次要情节(2,2)配合中心——axs

如何在python中使用次要情节函数绘图

对应的次要情节代码

得到skimage  import 数据   得到matplotlib  import  pyplot  as  plt      时间=moon  data.moon ()   时间=camera  data.camera ()   时间=image_minus  moon 安康;相机   +=image_plus  moon 相机   #,绘图   plt.rcParams [& # 39; font.sans-serif& # 39;],=, (& # 39; SimHei& # 39;), #,显示中文   无花果,axs =, plt.subplots (2, 2)      (0,0)中心——axs .imshow(月亮)   (0,0)中心——axs .set_title(“月亮图像“)      中心——axs [0, 1] .imshow(相机)   中心——axs [0, 1] .set_title(“摄影师图像“)      (1,0)中心——axs .imshow (image_plus)   (1,0)中心——axs .set_title(“月亮加摄影师图像“)      (1,1)中心——axs .imshow (image_minus)   (1,1)中心——axs .set_title(“月亮减摄影师图像“)      plt.tight_layout(), #,子图之间合理间距   plt.show(), #,显示图像

上述就是小编为大家分享的如何在python中使用次要情节函数绘图了,如果刚好有类似的疑惑,不妨参照上述分析进行理解。如果想知道更多相关知识,欢迎关注行业资讯频道。

如何在python中使用次要情节函数绘图