python画图设置坐标轴为科学记数法,如何在matplotlib中的轴上设置科学计数法

本文介绍了如何在Python的matplotlib库中设置图表的次级x轴坐标以使用科学记数法,避免标签重叠。通过格式化坐标轴刻度标签并旋转标签以增加空间来解决这个问题。
摘要由CSDN通过智能技术生成

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值