Home > Backend Development > Python Tutorial > Python implements two-dimensional array output as picture_python

Python implements two-dimensional array output as picture_python

不言
Release: 2018-04-04 16:09:06
Original
3387 people have browsed it

The editor below will share with you an article about how to output a two-dimensional array as a picture in Python. It has a good reference value and I hope it will be helpful to everyone. Let’s follow the editor and take a look

For two-dimensional arrays, img_mask


##

[[ 0 0 0 ..., 7 7 7]
 [ 0 0 0 ..., 7 7 7]
 [ 0 0 0 ..., 7 7 7]
 ..., 
 [266 266 266 ..., 253 253 253]
 [266 266 266 ..., 253 253 253]
 [266 266 266 ..., 253 253 253]]
Copy after login


The code displayed as a picture is:

##

import matplotlib.pyplot as pyplot 
pyplot.imshow(im_mask)
Copy after login

Related recommendations:


Python implements the method of using a generator to implement iterable objects

Python implements type checking of instance attributes

Python implements tree printing directory structure_python

The above is the detailed content of Python implements two-dimensional array output as picture_python. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template