-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimplot.jl
More file actions
58 lines (49 loc) · 2.13 KB
/
simplot.jl
File metadata and controls
58 lines (49 loc) · 2.13 KB
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
48
49
50
51
52
53
54
55
56
57
58
function simplot(x,y ;
psmaxisrange = [20 , 20e3 , -30 , 30],
psmxlabel = "Frequency in Hz",
psmylabel = "dB",
psmtitle = "SIMplot semilogx and dB",
psmlinestyle = "-k",
psmticklabelsize = 8,
psmaxislabelsize = 10,
psmtitlesize = 12,
)
#====================================================================
[[ note semicolon ]]
x
julia> function f(p, q ; r = 4, s = "hello")
println("p is $p")
println("q is $q")
return "r => $r, s => $s"
end
f (generic function with 1 method)
When called, this function expects two arguments, and will also accept
a number and a string, labelled r and s. If you don't supply them, the
default values are used:
====================================================================#
## matplotlib rcparams (startup...)
rc("xtick",labelsize=6)
rc("ytick",labelsize=6)
psmplot = semilogx(x,20.0 .* log10.(abs.(y)),psmlinestyle,linewidth=3)
psmaxis = axis(psmaxisrange)
psmaxes = gca()
thirdfreqs = ceil.(1000 * (2).^((-17:13)/3));
psmaxes.set_xticks(thirdfreqs)
psmaxes.xaxis.set_tick_params(which="minor",length=0,width=0)
psmaxes.xaxis.set_tick_params(which="major",direction="in",labelsize=psmticklabelsize)
psmaxes.yaxis.set_tick_params(which="major",direction="in",labelsize=psmticklabelsize)
## Xlabels_Dict = matread("Xlabels.mat");
## this seems to work
Xlabels_Dict =
Dict("Xlabels" =>
String[" 20", " 25", " 32", " 40",
"50", " 63", " 80", " 100", " 125", " 160", " 200", " 250", " 315",
"400", " 500", " 630", " 800", "1.0k", "1.3k", "1.6k", "2.0k", "2.5k",
"3.2k", "4.0k", "5.0k", "6.3k", "8.0k", " 10k", " 13k", " 16k",
"20k"])
psmaxes.set_xticklabels(Xlabels_Dict["Xlabels"])
grid(linestyle=":",color="black",linewidth=0.3)
xlabel(psmxlabel,fontsize=psmaxislabelsize)
ylabel(psmylabel,fontsize=psmaxislabelsize)
title(psmtitle,fontsize=psmtitlesize)
end