python勉強記録

Python,Matlab,VBA主に自分用の備忘録

matplotlibテンプレ

# -*- coding: utf-8 -*-


import matplotlib.pyplot as plt
import pandas as pd
import csv
import seaborn as sns

sns.set_style("white")
sns.set_style("ticks")
sns.set_style({"xtick.direction": "in","ytick.direction": "in"})

#plt.rcParams['font.family'] ='sans-serif'
plt.rcParams['font.family'] = "MS Gothic"

plt.text(2.5,50,"Hello", color="red", size=16)
plt.rcParams['font.sans-serif'] = ['Arial']
plt.rcParams['xtick.direction'] = 'in'
plt.rcParams['ytick.direction'] = 'in'
plt.rcParams['xtick.major.width'] = 1.0
plt.rcParams['ytick.major.width'] = 1.0
plt.rcParams['font.size'] = 8
plt.rcParams['axes.linewidth'] = 1.0
plt.rcParams['axes.grid']=True
plt.rcParams['grid.linestyle']='--'
plt.rcParams['grid.linewidth'] = 0.3

 

df=pd.read_csv("result_var")

x=df.temp.values.tolist()
y=df.specific.values.tolist()


plt.plot(x,y,marker="o",linestyle="None")
plt.title("conc_0.025", fontsize=20)
plt.xlabel("Temperature(K)", fontsize=20)
plt.ylabel("Specific heat(J/mol/K)", fontsize=20)
plt.show()