Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

plt imshow python

import matplotlib.pyplot as plt
w = 4
h = 3
d = 70
plt.figure(figsize=(w, h), dpi=d)
x = [[3, 4, 5],
     [2, 3, 4],
     [1, 2, 3]]

color_map = plt.imshow(x)
color_map.set_cmap("Blues_r")
plt.colorbar()
plt.savefig("out.png")
Comment

imshow of matplotlib

matplotlib.pyplot.imshow() Function:
The imshow() function in pyplot module of matplotlib library is used to display data as an image; i.e. on a 2D regular raster.

Syntax: matplotlib.pyplot.imshow(X, cmap=None, norm=None, aspect=None, interpolation=None, alpha=None, vmin=None, vmax=None, origin=None, extent=None, shape=, filternorm=1, filterrad=4.0, imlim=, resample=None, url=None, *, data=None, **kwargs)

Parameters: This method accept the following parameters that are described below:

X: This parameter is the data of the image.
cmap : This parameter is a colormap instance or registered colormap name.
Comment

PREVIOUS NEXT
Code Example
Python :: get all h1 beautifulsoup 
Python :: Print the norm of a vector and a matrix using numpy. 
Python :: sort dictionary 
Python :: __gt__ 
Python :: pyspark datetime add hours 
Python :: How to Convert Strings to Datetime in Pandas DataFrame 
Python :: hello world py 
Python :: list of files to zip python 
Python :: how to import pygame 
Python :: http.server python 
Python :: colab install library 
Python :: change case python 
Python :: flask send client to another web page 
Python :: import pyplot python 
Python :: adding numbers using python function 
Python :: list of prime numbers in python with list comprehension 
Python :: move the mouse in games python 
Python :: maping value to data in pandas dataframe 
Python :: python get duration of wav file 
Python :: python count total no of word in a text 
Python :: pandas drop na in column 
Python :: pandas dataframe scan column for values between numbers 
Python :: Write a python program to find the most frequent word in text file 
Python :: add pip to path 
Python :: double for in python 
Python :: python import beautifulsoup 
Python :: python remove background 
Python :: how to add color to python text 
Python :: pyqt5 button example 
Python :: how to set default user group in django 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =