Python数据分析与展示之matplolib库([matplotlib/matplotlib] Label subscript cutoff when increasing) 学习笔记手札及代码实战

[matplotlib/matplotlib] Label subscript cutoff when increasing dpi

  • Code for reproduction
  • Bug report
    • Bug summary
  • Matplotlib version

Code for reproduction

import matplotlib.pyplot as plt
fig,ax = plt.subplots(dpi=300)
ax.set_ylabel(r"$\frac{E_0}{E_{\infty}}$",
              rotation=0,fontsize=30,labelpad=20)
plt.savefig("test.png")

Python数据分析与展示之matplolib库([matplotlib/matplotlib] Label subscript cutoff when increasing) 学习笔记手札及代码实战_第1张图片

Bug report

Bug summary

When using a (latex) fraction in the y axis the subscript is cutoff when the dpi and fontsize are increased. This behavior does not appear when using the default settings for figure dpi (100).

import matplotlib.pyplot as plt
fig,ax = plt.subplots(dpi=100)
ax.set_ylabel(r"$\frac{E_0}{E_{\infty}}$",
              rotation=0,fontsize=30,labelpad=20)
plt.savefig("test.png")

Python数据分析与展示之matplolib库([matplotlib/matplotlib] Label subscript cutoff when increasing) 学习笔记手札及代码实战_第2张图片

Matplotlib version

Operating system: Windows 10
Matplotlib version: 3.1.3
Matplotlib backend (print(matplotlib.get_backend())): Qt5Agg
Python version: 3.7.6
Jupyter version (if applicable): N/A
Other libraries: None
Matplotlib was installed with baseline anaconda python

你可能感兴趣的:(python,数据分析,数据挖掘,人工智能,numpy)