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

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()
主站蜘蛛池模板: 兴义市| 清水河县| 义马市| 鄱阳县| 金沙县| 德惠市| 临沭县| 望城县| 镇安县| 聂荣县| 江华| 额济纳旗| 光泽县| 商丘市| 建湖县| 邢台市| 青铜峡市| 苗栗市| 岚皋县| 漳浦县| 农安县| 获嘉县| 天柱县| 塔河县| 左贡县| 法库县| 襄汾县| 巴青县| 曲周县| 仪陇县| 依兰县| 灵武市| 通山县| 乐业县| 河西区| 连平县| 大安市| 淮安市| 平昌县| 柳河县| 寿阳县|