Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/357.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
带网格的Python SAC绘图_Python_Plot - Fatal编程技术网

带网格的Python SAC绘图

带网格的Python SAC绘图,python,plot,Python,Plot,我需要使用.sac文件中的信息并根据网格进行绘制。我知道使用各种ObsPy函数可以使用st.plot()绘制地震图,但我似乎无法在网格上绘制地震图。我还尝试了下面给出的示例“”,但在尝试将x轴配置为使用UTCDatetime时遇到了问题。我不熟悉python和这类编程,因此非常感谢您的任何建议/帮助 使用的各种资源: “” “”流的plot()方法实际上会自动生成网格,例如,如果您使用默认示例并通过以下方式进行打印: from obspy.core import read st = read()

我需要使用.sac文件中的信息并根据网格进行绘制。我知道使用各种ObsPy函数可以使用
st.plot()
绘制地震图,但我似乎无法在网格上绘制地震图。我还尝试了下面给出的示例“”,但在尝试将x轴配置为使用UTCDatetime时遇到了问题。我不熟悉python和这类编程,因此非常感谢您的任何建议/帮助

使用的各种资源: “”


“”

流的
plot()
方法实际上会自动生成网格,例如,如果您使用默认示例并通过以下方式进行打印:

from obspy.core import read
st = read()  # without filename an example file is loaded
tr = st[0]   # we will use only the first channel
tr.plot()

您可能需要使用中指出的
勾号数
勾号格式
勾号旋转
参数

但是,如果需要更多控制,可以将
matplotlib
图形作为输入参数传递给
plot()
方法:

from obspy.core import read
import matplotlib.pyplot as plt

fig = plt.figure()

st = read('/path/to/file.sac')
st.plot(fig=fig)

# at this point do whatever you want with your figure, e.g.
fig.gca().set_axis_off()

# finally display your figure
fig.show()

希望有帮助。

plot()
方法实际上会自动生成网格,例如,如果您使用默认示例并通过以下方式进行绘制:

from obspy.core import read
st = read()  # without filename an example file is loaded
tr = st[0]   # we will use only the first channel
tr.plot()

您可能需要使用中指出的
勾号数
勾号格式
勾号旋转
参数

但是,如果需要更多控制,可以将
matplotlib
图形作为输入参数传递给
plot()
方法:

from obspy.core import read
import matplotlib.pyplot as plt

fig = plt.figure()

st = read('/path/to/file.sac')
st.plot(fig=fig)

# at this point do whatever you want with your figure, e.g.
fig.gca().set_axis_off()

# finally display your figure
fig.show()
希望能有帮助