/ Python And R Data science skills: 70 subplots

Friday, 16 February 2018

70 subplots

https://vlrtraining.com/courses/python-data-science-beginner-tutorial 70 subplots
In [7]:
import matplotlib.pyplot as plt
In [3]:
 import numpy as np
x = np.linspace(0, 5, 11)
y = x ** 2 
 %matplotlib inline
In [10]:
plt.plot(x, y, 'r') # 'r' is the color red
plt.xlabel('X Axis Title Here')
plt.ylabel('Rupees')
plt.title('String Title Here')
plt.plot(x, y, 'r')
Out[10]:
[<matplotlib.lines.Line2D at 0x7ddb550>]
In [9]:
# plt.subplot(nrows, ncols, plot_number)
plt.subplot(1,3,1)
plt.plot(x, y, 'r') # More on color options later
plt.subplot(1,3,2)
plt.plot(y, x, 'g');
plt.subplot(1,3,3)
plt.plot(y, x, 'g');
In [18]:
plt.subplot(2,2,1)
plt.plot(x, y, 'r')
plt.subplot(2,2,2)
plt.plot(x, y, 'r')
plt.subplot(1,3,2)
plt.plot(y, x, 'r')
plt.subplot(1,3,3)
plt.plot(x, y, 'r')
Out[18]:
[<matplotlib.lines.Line2D at 0xa5a99b0>]

No comments:

Post a Comment