Horje
matplotlib plot two graphs side by side Code Example
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()




Python

Related
kaggle vs colab Code Example kaggle vs colab Code Example
django template capitalize equivalent Code Example django template capitalize equivalent Code Example
ggplot2 histogram Code Example ggplot2 histogram Code Example
python remove non letters from string Code Example python remove non letters from string Code Example
pyvenv.cfg file download Code Example pyvenv.cfg file download Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8