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

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()
主站蜘蛛池模板: 增城市| 江永县| 惠水县| 南康市| 休宁县| 微山县| 太谷县| 晋州市| 宜良县| 东辽县| 昔阳县| 全椒县| 涪陵区| 常州市| 日土县| 政和县| 张掖市| 长岛县| 永宁县| 渝中区| 林甸县| 巴中市| 辽阳县| 桐梓县| 左云县| 东乡县| 新宾| 淮南市| 衡南县| 昂仁县| 萨嘎县| 石泉县| 古浪县| 资阳市| 临武县| 桦川县| 南华县| 澄江县| 丰都县| 湘潭县| 巴林左旗|