Installing matplotlib and Basic plotting in Python using matplotlib

It is possible to draw graphs like MATLAB using Python.

The first thing you should do is to install matplotlib in your system.

After setting up the 'setuptools' (This was introduced the other post in 'A Note of Mr. Forest', you just execute this command.

>>> pip install matplotlib

and then matplotlib will be installed.


And this is basic plotting.


# import plot module
from pylab import *

# values of x axis
x = range(0,100)
# values of y axis
y = []
# y = 2*x*x
for i in range(len(x)):
     y.append(x[i]*x[i]*2)

# Make figure
figure()
# Build plot
plot(x,y)
# Show the plot
show()

The output like below!



Thanks

Have Fun!







댓글

이 블로그의 인기 게시물

미국 포닥, 한국으로 돌아가는 이유? (Why do postdoc go back to Korea?)

미국 포닥 - 비지팅 포닥 VS 풀펀딩 포닥 (Visiting Scholar VS Postdoctoral Fellow)

미국 포닥 직위, 타이틀, 명칭? - Visiting Scholar, Postdoctoral Fellow, Research Associate, Research Scientist, Research Professor