Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

plt multiple figures to show

  
# create figure
fig = plt.figure(figsize=(10, 7))
  
# setting values to rows and column variables
rows = 2
columns = 2
  
# reading images
Image1 = cv2.imread('Image1.jpg')
Image2 = cv2.imread('Image2.jpg')
Image3 = cv2.imread('Image3.jpg')
Image4 = cv2.imread('Image4.jpg')
  
# Adds a subplot at the 1st position
fig.add_subplot(rows, columns, 1)
  
# showing image
plt.imshow(Image1)
plt.axis('off')
plt.title("First")
  
# Adds a subplot at the 2nd position
fig.add_subplot(rows, columns, 2)
  
# showing image
plt.imshow(Image2)
plt.axis('off')
plt.title("Second")
  
# Adds a subplot at the 3rd position
fig.add_subplot(rows, columns, 3)
  
# showing image
plt.imshow(Image3)
plt.axis('off')
plt.title("Third")
  
# Adds a subplot at the 4th position
fig.add_subplot(rows, columns, 4)
  
# showing image
plt.imshow(Image4)
plt.axis('off')
plt.title("Fourth")
Comment

multiple figures matplotlib

plt.figure(1)
#code for first plt
plt.figure(2)
#code for second plt
plt.show()
Comment

plot multiple figures in matplot lib

plt.figure(1)
Comment

PREVIOUS NEXT
Code Example
Python :: django update model 
Python :: python big comment 
Python :: create text file in directory python linux 
Python :: python do something before exit 
Python :: case statement in querset django 
Python :: python list all files of directory in given pattern 
Python :: panda categorical data into numerica 
Python :: scroll horizontal excel 
Python :: how to do element wise multiplication in numpy 
Python :: how to check python version on terminal 
Python :: python ascii 
Python :: python use variable in another file 
Python :: pandas transpose 
Python :: check pygame version 
Python :: merge two dict python 3 
Python :: convert string to list of dictionaries 
Python :: python bold text in terminal 
Python :: python join with int 
Python :: python reverse geocode 
Python :: password generator in python 
Python :: seaborn define linewidth 
Python :: pandas sort by date descending 
Python :: string hex to decimal python 
Python :: iterate through attributes of class python 
Python :: python pair two lists into a dictionary 
Python :: tkinter menus 
Python :: how to check if an input is a string in python 
Python :: check if date is valid python 
Python :: how to distribute a dataset in train and test using scikit 
Python :: python check if two sets intersect 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =