Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 919 Bytes

README.md

File metadata and controls

39 lines (27 loc) · 919 Bytes

Matplotlib_Scistyle

Matplotlib science style

Put the folder stylelib to your computer C:\Users\[username]\.matplotlib ,and you can use the science style easily by

import matplotlib.pyplot as plt
plt.style.use('science')

For example:

import matplotlib.pyplot as plt
import numpy as np

plt.style.use('science') # use science style

# Create data
x = np.arange(0,6*np.pi,np.pi/100)
y1=np.sin(x)
y2=np.cos(x)

# Plot and set figure size
fig, ax = plt.subplots(figsize=(7, 1.4))
plt.plot(x,y1)
plt.plot(x,y2)

# save and show the figure
fig.savefig('fig14b.svg', dpi=600)
plt.show()

示例图

These are drawn using the Science style

示例图 示例图