Making Python's Matplotlib Graphics Look Like Graphics Created Using Originpro
I may have created a duplicate, but could not find exactly what I was looking for in any thread. I created graphics using OriginPro 8.5G and can not quite re-create them using matp
Solution 1:
I think the following is roughly the equivalent to the Origin figure.
Unfortunately, not everything can be determined via rcParams, such as the limits and the minor tick locations. Also I changed scatter
to plot
, which makes it easier to get hollow markers.
from matplotlib import rcParams, cycler
import matplotlib.pyplot as plt
from matplotlib.ticker import AutoMinorLocator
rcParams['font.family'] = 'sans-serif'
rcParams['font.sans-serif'] = ['Arial']
rcParams['font.size'] = 16
rcParams['axes.linewidth'] = 1.1
rcParams['axes.labelpad'] = 10.0
plot_color_cycle = cycler('color', ['000000', '0000FE', 'FE0000', '008001', 'FD8000', '8c564b',
'e377c2', '7f7f7f', 'bcbd22', '17becf'])
rcParams['axes.prop_cycle'] = plot_color_cycle
rcParams['axes.xmargin'] = 0
rcParams['axes.ymargin'] = 0
rcParams.update({"figure.figsize" : (6.4,4.8),
"figure.subplot.left" : 0.177, "figure.subplot.right" : 0.946,
"figure.subplot.bottom" : 0.156, "figure.subplot.top" : 0.965,
"axes.autolimit_mode" : "round_numbers",
"xtick.major.size" : 7,
"xtick.minor.size" : 3.5,
"xtick.major.width" : 1.1,
"xtick.minor.width" : 1.1,
"xtick.major.pad" : 5,
"xtick.minor.visible" : True,
"ytick.major.size" : 7,
"ytick.minor.size" : 3.5,
"ytick.major.width" : 1.1,
"ytick.minor.width" : 1.1,
"ytick.major.pad" : 5,
"ytick.minor.visible" : True,
"lines.markersize" : 10,
"lines.markerfacecolor" : "none",
"lines.markeredgewidth" : 0.8})
for ion inrange(1, output_array_size_x):
plt.plot(output_array[:,0], output_array[:,ion], marker='D', ls="none")
plt.xlim(0, 13)
plt.ylim(0, None)
plt.ylabel('Normalized signal intensity')
plt.xlabel('Excitation voltage [eV]')
plt.gca().xaxis.set_minor_locator(AutoMinorLocator(n=2))
plt.gca().yaxis.set_minor_locator(AutoMinorLocator(n=2))
plt.savefig("out.png", dpi=1000)
plt.show()
Post a Comment for "Making Python's Matplotlib Graphics Look Like Graphics Created Using Originpro"