Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

matplotlib plot two graphs side by side

import matplotlib.pyplot as plt
import numpy as np

# Simple data to display 
x = np.linspace(0, 2 * np.pi, 400)
y = np.sin(x ** 2)

# the container holding the two Axes have already been unpacked
# useful if just few Axes have been created
f, (ax1, ax2) = plt.subplots(1, 2) 
ax1.plot(x, y)
ax1.set_title('Left plot')

ax2.scatter(x, y)
ax2.set_title('Right plot')

plt.tight_layout()
plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: python get all folders in directory 
Python :: python most common element in list 
Python :: first position dict python 
Python :: check corently installed epython version 
Python :: how to get continuous mouse position with pyautogui in python 
Python :: flask if statement 
Python :: get files in directory python 
Python :: web3py convert from wei to ether 
Python :: pytorch tensor change dimension order 
Python :: python heart code 
Python :: python pil invert image color 
Python :: how to get the current date hour minute month year in python 
Python :: python datetime add minutes 
Python :: intersection of two lists python 
Python :: pyton read text file 
Python :: python how much memory does a variable need 
Python :: create an array with same value python 
Python :: next prime number in python 
Python :: disable devtools listening on ws://127.0.0.1 python 
Python :: standardize columns in pandas 
Python :: python first day of last month 
Python :: remove None pandas 
Python :: pyplot define plotsize 
Python :: spark dataframe get unique values 
Python :: python url encoding 
Python :: tracking mouse position tkinter python 
Python :: tkinter info box 
Python :: datetime one week ago python 
Python :: python numpy array check if all nans 
Python :: python day from datetime 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =