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

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()
主站蜘蛛池模板: 临洮县| 田东县| 墨玉县| 平阳县| 海安县| 云安县| 东城区| 揭东县| 祁连县| 三河市| 宁津县| 海口市| 凭祥市| 遂宁市| 九龙城区| 滦平县| 定襄县| 屏边| 连平县| 雷州市| 咸丰县| 新郑市| 镇赉县| 锡林郭勒盟| 安达市| 塘沽区| 文山县| 开封县| 西宁市| 沂水县| 北票市| 出国| 卫辉市| 凤庆县| 城口县| 金寨县| 洪雅县| 合肥市| 仁寿县| 沙湾县| 青田县|