【发布时间】:2020-04-01 00:12:49
【问题描述】:
我可能创建了一个副本,但在任何线程中都找不到我正在寻找的确切内容。我使用 OriginPro 8.5G 创建了图形,但无法使用 matplotlib 重新创建它们。我对使用 mpl 设置图形样式很陌生,但我会附上我已经尝试过的内容并展示一些图片。
使用 OriginPro 8.5G 创建的绘图
使用 matplotlib.pyplot 创建的绘图
使用的代码如下:
import matplotlib as mpl
from matplotlib import rcParams, cycler
import matplotlib.pyplot as plt
from matplotlib.pyplot import plot, show
rcParams['font.family'] = 'sans-serif'
rcParams['font.sans-serif'] = ['Arial', 'Helvetica', 'Verdana', 'DejaVu Sans']
rcParams['font.size'] = 15
rcParams['axes.linewidth'] = 1.1
rcParams['axes.labelpad'] = 5.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
for ion in range(1, output_array_size_x):
plt.scatter(output_array[:,0], output_array[:,ion], marker='D')
plt.ylabel('Normalized signal intensity')
plt.xlabel('Excitation voltage [eV]')
plt.show()
output_array_size_x 在我的输入文件中是可变的,但在本例中是3。
我想具体做什么:
我希望标记是未填充且透明的,如 Origin 图形的示例中所示
边距/内边距理想情况下应与原始图形中的相同
y 轴和 x 轴应恰好从 0.0 开始,而不是略高于
output_array 如下所示:
0.000000000000000000e+00 9.613190459262268561e-01 3.513449460836592236e-02 3.546459465407208068e-03
1.500000000000000000e+00 9.344751080827480294e-01 6.157866582480509693e-02 3.946226092446923107e-03
3.000000000000000000e+00 8.794867691496672801e-01 1.158346590855604402e-01 4.678571764772331693e-03
4.500000000000000000e+00 7.778204354741402593e-01 2.161575165907969054e-01 6.022047935062798014e-03
6.000000000000000000e+00 6.237757882444531221e-01 3.677228493577267554e-01 8.501362397820164118e-03
7.500000000000000000e+00 4.352079352079352148e-01 5.524160524160524055e-01 1.237601237601237622e-02
9.000000000000000000e+00 3.037328226321271418e-01 6.814501226354869878e-01 1.481705473238584779e-02
1.050000000000000000e+01 1.979494349295118361e-01 7.804380752650588171e-01 2.161248980542933643e-02
1.200000000000000000e+01 1.991559485530546569e-01 7.682877813504823683e-01 3.255627009646302333e-02
1.300000000000000000e+01 2.117732033224991040e-01 7.502347417840375954e-01 3.799205489346334230e-02
1.200000000000000000e+01 1.737333926641662918e-01 7.915580700527620195e-01 3.470853728307164016e-02
1.050000000000000000e+01 2.083233790434325661e-01 7.730899708538391257e-01 1.858665010272827350e-02
9.000000000000000000e+00 2.918319459187664333e-01 6.940052516900385715e-01 1.416280239119503855e-02
7.500000000000000000e+00 4.381243063263041138e-01 5.503408910734104431e-01 1.153480260028539803e-02
6.000000000000000000e+00 6.196725291324989282e-01 3.727206517047906842e-01 7.606819162710401483e-03
4.500000000000000000e+00 7.784601309988418150e-01 2.166833740474359837e-01 4.856494953722177016e-03
3.000000000000000000e+00 8.823418723003891850e-01 1.136723260488388954e-01 3.985801650771928287e-03
1.500000000000000000e+00 9.367085677246105302e-01 6.041314597464329805e-02 2.878286300746193873e-03
0.000000000000000000e+00 9.603569624515911896e-01 3.714430038727058181e-02 2.498737161138238610e-03
如果需要任何进一步的信息,请告诉我! 非常感谢您的帮助。
【问题讨论】:
标签: python matplotlib plot layout