論文用の必要最低限な設定。
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
# load data
x = []
y = []
for li in open("./abc.csv", 'r'):
xi, yi = li.rstrip().split(',')
x.append(xi)
y.append(yi)
# font settings etc.
sns.set(font_scale=1.4, font="Times New Roman")
sns.set_style("darkgrid", {'font.family':'serif', 'font.serif':'Times New Roman'})
# label for x and y axis
plt.xlabel('label on x')
plt.ylabel('label on y')
# adjust margin (if necessary)
fig, ax = plt.subplots()
ax.margins(0.05)
# plot and save the figure
plt.plot(x,y)
plt.savefig("./abc.pdf")
#%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
x = [1,2,3,4,5]
y0 = [1,2,3,4,5]
y1 = [1,2,3,4,5]
y2 = [1,2,3,4,5]
y3 = [1,2,3,4,5]
y4 = [1,2,3,4,5]
sns.set(font_scale=1.4)
sns.set_palette("husl", 5)
sns.set_style("whitegrid")
plt.xlabel('hoge', fontsize=18)
plt.ylabel('hoge', fontsize=18)
plt.plot(x,y0, label='hoge')
plt.plot(x,y1, label='hoge')
plt.plot(x,y2, label='hoge')
plt.plot(x,y3, label='hoge')
plt.plot(x,y4, label='hoge')
plt.legend()
plt.savefig("./hoge.pdf")
最終更新:2017年07月20日 07:36