R and Python language line chart

1, with the underlying graphics system of R

 x <- c(21, 33, 42, 46, 60)
 y <- c(16, 20, 27, 41, 61)
 
plot(x, y, type='b')

 

 

2 matplotlib library

import matplotlib.pyplot as plt 

x = [21, 33, 42, 46, 60]
y = [16, 20, 27, 41, 61]

plt.plot(x, y, marker='o', ls='--', c='k') plt.xlabel('x') plt.ylabel('y') plt.show()

 

 

note:

R may automatically be given axis title.

1, with the underlying graphics system of R

 x <- c(21, 33, 42, 46, 60)
 y <- c(16, 20, 27, 41, 61)
 
plot(x, y, type='b')

 

 

2 matplotlib library

import matplotlib.pyplot as plt 

x = [21, 33, 42, 46, 60]
y = [16, 20, 27, 41, 61]
 plt.plot(x, y, marker='o', ls='--', c='k') plt.xlabel('x') plt.ylabel('y') plt.show()

 

 

note:

R may automatically be given axis title.

Guess you like

Origin www.cnblogs.com/shanger/p/12178039.html