I am trying to plot a graph with two separate x-axis. One being some valve openning and the other the corresponding leak rate. I managed to make it work pretty well, though the format of that secondary axis doesn't always show scientific notations as seen on the figure down bellow
Awful overlapping labels, see the upper axis
How to force scientific notation display so that the labels wont overlap?
Here is the script I am using:
#HEADERS
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker
from matplotlib import rc
rc('font', **{'family':'sans-serif','sans-serif':['Helvetica']})
rc('text', usetex=True)
#/HEADERS
turns = np.array([11.000, 11.500, 11.750, 12.000, 12.250, 12.375])
leak = np.array([3.89e-05, 4.

本文介绍了如何在Python的matplotlib库中设置图表的次级x轴坐标以使用科学记数法,避免标签重叠。通过格式化坐标轴刻度标签并旋转标签以增加空间来解决这个问题。
最低0.47元/天 解锁文章


被折叠的 条评论
为什么被折叠?



