官术网_书友最值得收藏!

Matplotlib

This is a popular Python package for plotting and displaying data and images. To use in Python, the scripts is as follows:

import matplotlib.pyplot as plt 

If we want to plot inside Jupyter notebook, add the following command:

%matplotlib inline 

An example function to display an image is as follows:

def plot_img(input_image): 
"""
Takes in image
Plots image using matplotlib
"""
plt.figure(figsize=(12,8))

# change color channels order for matplotlib
plt.imshow(input_image)

# For easier view, turn off axis around image
plt.axis('off')
plt.show()
主站蜘蛛池模板: 巩义市| 浦东新区| 玛曲县| 恩平市| 通河县| 永善县| 闵行区| 普洱| 平南县| 财经| 资兴市| 贵南县| 万盛区| 寻甸| 泰宁县| 灵台县| 金门县| 中牟县| 翁源县| 曲靖市| 靖州| 斗六市| 泰州市| 将乐县| 泾源县| 盐津县| 南开区| 游戏| 南木林县| 呼伦贝尔市| 正阳县| 丹阳市| 长治县| 库尔勒市| 察哈| 衡东县| 措勤县| 日喀则市| 鱼台县| 天峨县| 郑州市|