Last active
March 11, 2018 09:05
-
-
Save bluepost59/133efb85f3f50a16fd2e823074879c28 to your computer and use it in GitHub Desktop.
資料作りのためのmatplotlib入門(1) 1次元図 ref: https://qiita.com/Bluepost59/items/f2b0a1a8449440de6a1b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do i=1,Nx | |
write(UNITNUM,*) i,a(i) | |
end do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 0.000E00 | |
1 0.628E00 | |
... | |
10 0.810E01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib as mpl | |
mpl.use('Agg') | |
import matplotlib.pyplot as plt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mydata = np.loadtxt('mydata.txt') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[1,0.0000], | |
[2,0.628], | |
..., | |
10,0.810]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myax.plot(x,y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myax.plot(mydata[:,0],mydata[:,1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib as mpl | |
matplotlib.use('Agg') | |
import matplotlib.pyplot as plt | |
mydata = np.loadtxt('mydata.txt') | |
myfig = plt.figure() | |
myax = myfig.add_subplot(1,1,1) | |
myax.plot(mydata[:,0],mydata[:,1]) | |
myfig.savefig('mydata.png') | |
myfig.clf() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib as mpl | |
matplotlib.use('Agg') | |
import matplotlib.pyplot as plt | |
mydata = np.loadtxt('mydata.txt') | |
myfig = plt.figure() | |
myax = myfig.add_subplot(1,1,1) | |
myax.plot(mydata[:,0],mydata[:,1]) | |
myfig.savefig('mydata.png') | |
myfig.clf() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
余計なファイルを削除