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 plot in one figure python

import matplotlib.pyplot as plt

plt.plot(<X AXIS VALUES HERE>, <Y AXIS VALUES HERE>, 'line type', label='label here')
plt.plot(<X AXIS VALUES HERE>, <Y AXIS VALUES HERE>, 'line type', label='label here')
plt.legend(loc='best')
plt.show()
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 :: sort a dict by values 
Python :: type checking python 
Python :: how to loop through pages of pdf using python 
Python :: python int binary 
Python :: how to use drf permission class with class method actions 
Python :: Python List count() example 
Python :: break line in string python 
Python :: python import colors 
Python :: R sample() funciton in python 
Python :: turtle example 
Python :: pandas if python 
Python :: delete last few items from a list python 
Python :: save pillow image to database django 
Python :: change password serializer 
Python :: move column in pandas dataframe 
Python :: take absolute value in python 
Python :: numpy array deepcopy 
Python :: how ro have a incresing variable in python 
Python :: how to convert float to string in python 
Python :: python check equality of floats 
Python :: axios django post 
Python :: download image from url selenium python 
Python :: django channel 
Python :: expand alphabets in python 
Python :: how to check a string is empty in python 
Python :: csv manipulation python 
Python :: python get file line count 
Python :: python terminal progress bar 
Python :: discord bot python example 
Python :: python is instance 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =