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 :: watershed segmentation 
Python :: get nth character of string python 
Python :: import os in python 
Python :: principal component analysis (pca) 
Python :: install python anaconda 
Python :: python string to uppercase 
Python :: python in intellij 
Python :: strip function in python 
Python :: input() function in python 
Python :: concatenate strings and int python 
Python :: f string 
Python :: create a new column in pandas dataframe based on the existing columns 
Python :: return max(max(a,b),max(c,d)); 
Python :: dictionary get all values 
Python :: comment all selected lines in python 
Python :: django filter values with e and operator 
Python :: generating random numbers numpy 
Python :: dot product of lists 
Python :: np.divide 
Python :: /n in python 
Python :: queryset django 
Python :: add python to path windows 10 
Python :: pandas group by to dataframe 
Python :: save python pptx in colab 
Python :: Python OrderedDict - LRU 
Python :: using pandas stack and subset to return a dataframe object of highly correated pairs 
Python :: how to save xml file in python 
Python :: pycountry get 
Python :: comment on inclut date et heure en python svp 
Python :: python recase 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =