-
Notifications
You must be signed in to change notification settings - Fork 2
/
seisPlotAmplitude.jl
47 lines (35 loc) · 1.23 KB
/
seisPlotAmplitude.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""
SeisPlotAmplitude(d,fmax,dy ; <keyword arguments>)
Plot amplitude-frequency 2D seismic data `d`
# Arguments
- `d::Array{Real,2}`: 2D data to plot.
# Keyword arguments
- `fig=nothing`: the figure we want to plot on. If not supplied, one will be created and returned.
- `ax=nothing`: the axis we want to plot on. If not supplied, one will be created and returned.
- `fmax=100`: maximum frequency.
- `dy=0.004`: time sample interval.
- `normalize=false`: whether or not to normalize the data
- `color=:red`: color of the plot.
- `label=""`: plot label to be included in legend
# Example
```julia
julia> d = SeisLinearEvents();
julia> f, ax = SeisPlotAmplitude(d,100,0.004);
```
Author: Firas Al Chalabi (2024)
"""
function seisPlotAmplitude(d::Array{<:Real, 2}; fig=nothing, ax=nothing, fmax=100, dy=0.004,
normalize=false, color=:black, label="")
if isnothing(fig)
fig = Figure()
end
if isnothing(ax)
ax = Axis(fig[1,1])
ax.title = "Amplitude Spectrum"
ax.xlabel = "Frequency (Hz)"
ax.ylabel = "Amplitude"
ax.xgridvisible = true
end
seisamplitudeplot!(ax, d, fmax=fmax, dy=dy, normalize=normalize, color=color, label=label)
return fig, ax
end