Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sebastian Steinlechner
pykat
Commits
9acf1206
Commit
9acf1206
authored
Dec 02, 2015
by
Daniel Brown
Browse files
updating plotting
parent
939d328e
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
bin/test_plot.py
View file @
9acf1206
...
...
@@ -32,7 +32,7 @@ attr m1 Rc 1
kat
=
finesse
.
kat
()
kat
.
parseCommands
(
code
)
kat
.
add
(
xaxis
(
"l
in
"
,
[
0
,
360
],
kat
.
m2
.
phi
,
500
))
kat
.
add
(
xaxis
(
"l
og
"
,
[
1
,
360
],
kat
.
m2
.
phi
,
500
))
kat
.
m1
.
Rcx
=
-
1000.0
kat
.
m1
.
Rcy
=
-
1000.0
...
...
@@ -42,7 +42,5 @@ kat.m2.Rcy = 1000.0
kat
.
maxtem
=
0
out
=
kat
.
run
()
#fig = out.plot(yaxis="log abs:deg")
#fig.savefig("test_plot.pdf")
out
.
info
()
\ No newline at end of file
fig
=
out
.
plot
()
\ No newline at end of file
examples/pykat_plotting.ipynb
View file @
9acf1206
This diff is collapsed.
Click to expand it.
pykat/finesse.py
View file @
9acf1206
...
...
@@ -315,7 +315,7 @@ class katRun(object):
_func2
=
lambda
x
:
np
.
rad2deg
(
np
.
angle
(
x
))
plot_cmd1
=
plot_cmd
plot_cmd2
=
pyplot
.
plot
plot_cmd2
=
pyplot
.
plot
if
kat
.
xaxis
.
scale
==
"lin"
else
pyplot
.
semilogx
dual_plot
=
True
elif
"db:deg"
in
kat
.
yaxis
:
...
...
@@ -323,7 +323,7 @@ class katRun(object):
_func2
=
lambda
x
:
np
.
rad2deg
(
np
.
angle
(
x
))
plot_cmd1
=
plot_cmd
plot_cmd2
=
pyplot
.
plot
plot_cmd2
=
pyplot
.
plot
if
kat
.
xaxis
.
scale
==
"lin"
else
pyplot
.
semilogx
dual_plot
=
True
elif
"abs"
in
kat
.
yaxis
:
...
...
@@ -352,14 +352,14 @@ class katRun(object):
if
not
dual_plot
:
plot_cmd1
(
self
.
x
,
_func1
(
self
[
det
]),
label
=
det
)
else
:
pyplot
.
subplot
(
2
,
1
,
1
)
ax
=
pyplot
.
subplot
(
2
,
1
,
1
)
l
,
=
plot_cmd1
(
self
.
x
,
_func1
(
self
[
det
]),
label
=
det
)
pyplot
.
subplot
(
2
,
1
,
2
)
plot_cmd2
(
self
.
x
,
_func2
(
self
[
det
]),
color
=
l
.
get_color
(),
ls
=
l
.
get_linestyle
(),
label
=
det
)
if
dual_plot
:
pyplot
.
subplot
(
2
,
1
,
1
)
ax
=
pyplot
.
subplot
(
2
,
1
,
1
)
pyplot
.
xlabel
(
self
.
xlabel
,
fontsize
=
pyplot
.
rcParams
[
"font.size"
])
pyplot
.
xlim
(
self
.
x
.
min
(),
self
.
x
.
max
())
if
title
is
not
None
:
pyplot
.
title
(
title
,
fontsize
=
pyplot
.
rcParams
[
"font.size"
]
-
1
)
...
...
pykat/plotting.py
View file @
9acf1206
...
...
@@ -58,6 +58,8 @@ def init_pykat_plotting(mode="display", dpi=100):
else
:
raise
(
BaseException
(
"Plotting mode must be either 'display' or 'paper'."
))
mpl
.
rcParams
[
'axes.color_cycle'
]
=
[
'b'
,
'r'
,
'k'
,
'g'
,
'c'
,
'm'
,
'y'
]
mpl
.
rcParams
[
'lines.linewidth'
]
=
1.2
mpl
.
rcParams
.
update
({
"figure.figsize"
:
(
6
,
3.708
)})
mpl
.
rcParams
.
update
({
'font.size'
:
11
})
mpl
.
rcParams
.
update
({
'figure.dpi'
:
__DPI__
})
...
...
@@ -67,7 +69,7 @@ def init_pykat_plotting(mode="display", dpi=100):
mpl
.
rcParams
.
update
({
'axes.axisbelow'
:
True
})
mpl
.
rcParams
.
update
({
'grid.linewidth'
:
0.25
})
mpl
.
rcParams
.
update
({
'grid.linestyle'
:
":"
})
mpl
.
rcParams
.
update
({
'grid.color'
:
(
0.
7
,
0.
7
,
0.
7
,
1
)})
mpl
.
rcParams
.
update
({
'grid.color'
:
(
0.
6
,
0.
6
,
0.
6
,
1
)})
mpl
.
rcParams
.
update
({
'savefig.bbox'
:
"tight"
})
mpl
.
rcParams
.
update
({
'savefig.pad_inches'
:
0.05
})
mpl
.
rcParams
.
update
({
'xtick.labelsize'
:
"small"
})
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment