我刚从C和Matlab接触Python。我正在创建一个脚本,它生成对数概率(logyaxis-probability xaxis)图,用于洪水频率分析。我正在使用以下Stackoverflow解决方案进行xaxis概率缩放:
这个解决方案非常适合xaxis。但是,当我将yaxis缩放为log10时,yaxis标签将消失。以下是用于创建绘图的代码;“概率”调用指使用上述Stackoverflow解决方案的概率轴缩放:# Step 1: load the needed pacakages
import numpy as np
import matplotlib.pyplot as plt
from numpy import ma
from matplotlib import scale as mscale
from matplotlib import transforms as mtransforms
from scipy.optimize import curve_fit
# Step 2: Load up some files and specify variables
# I have not included this part of the code b/c it works fine
# Step 3: Execute the xaxis proability scaling code referenced above
# Step 4: Create a figure
fig = plt.figure(1)
# Call the firts subplot
ax = fig.add_subplot(2,1,1)
# Create the first subplot
scatter, =