Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pykat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sean Leavey
pykat
Commits
c8935b52
Commit
c8935b52
authored
9 years ago
by
Daniel Brown
Browse files
Options
Downloads
Patches
Plain Diff
adding more options to plotting
parent
c44cdc2d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pykat/finesse.py
+42
-21
42 additions, 21 deletions
pykat/finesse.py
with
42 additions
and
21 deletions
pykat/finesse.py
+
42
−
21
View file @
c8935b52
...
@@ -259,7 +259,9 @@ class katRun(object):
...
@@ -259,7 +259,9 @@ class katRun(object):
print
(
"
One xaxis used: %s
"
%
kat
.
xaxis
.
getFinesseText
())
print
(
"
One xaxis used: %s
"
%
kat
.
xaxis
.
getFinesseText
())
def
plot
(
self
,
detectors
=
None
,
filename
=
None
,
show
=
True
,
yaxis
=
None
,
legend
=
True
,
loc
=
0
,
title
=
None
,
styles
=
None
):
def
plot
(
self
,
detectors
=
None
,
filename
=
None
,
show
=
True
,
yaxis
=
None
,
legend
=
True
,
loc
=
0
,
title
=
None
,
styles
=
None
,
ylabel
=
None
,
y2label
=
None
,
xlabel
=
None
,
x2label
=
None
):
"""
"""
This will generate a plot for the output data of this particular pykat run.
This will generate a plot for the output data of this particular pykat run.
It will attempt to generate a plot that shows all the various traces and plots
It will attempt to generate a plot that shows all the various traces and plots
...
@@ -269,13 +271,18 @@ class katRun(object):
...
@@ -269,13 +271,18 @@ class katRun(object):
There are some additional keyword options to customise the plot output slightly:
There are some additional keyword options to customise the plot output slightly:
detectors: a list of detectors that you want to plot
detectors: a list of detectors that you want to plot
filename: providing a filename here will save the plot to a file. The format is given by the extension provided.
filename: providing a filename here will save the plot to a file.
The format is given by the extension provided.
show: True | False - whether to display the plot or not
show: True | False - whether to display the plot or not
yaxis: Set the Finesse yaxis command to base the plot on. By default the original one will be used.
yaxis: Set the Finesse yaxis command to base the plot on. By
default the original one will be used.
legend: True | False - whether to include a legend
legend: True | False - whether to include a legend
loc: Location value for the legend, the usual matplotlib one.
loc: Location value for the legend, the usual matplotlib one.
title: Provide a title for the plot if required.
title: Provide a title for the plot if required.
styles: A dictionary which keys being the detector names and the value being a colour and linestyle of the sort
'
k:
'
styles: A dictionary which keys being the detector names and the
value being a colour and linestyle of the sort
'
k:
'
ylabel, xlabel: Text for the first plot x and y labels
y2label, x2label: Text for the second plot x and y labels
"""
"""
import
matplotlib.pyplot
as
pyplot
import
matplotlib.pyplot
as
pyplot
import
pykat.plotting
as
plt
import
pykat.plotting
as
plt
...
@@ -362,31 +369,45 @@ class katRun(object):
...
@@ -362,31 +369,45 @@ class katRun(object):
pyplot
.
subplot
(
2
,
1
,
2
)
pyplot
.
subplot
(
2
,
1
,
2
)
plot_cmd2
(
self
.
x
,
_func2
(
self
[
det
]),
color
=
l
.
get_color
(),
ls
=
l
.
get_linestyle
(),
label
=
det
)
plot_cmd2
(
self
.
x
,
_func2
(
self
[
det
]),
color
=
l
.
get_color
(),
ls
=
l
.
get_linestyle
(),
label
=
det
)
if
dual_plot
:
if
ylabel
is
None
:
if
"
abs
"
in
kat
.
yaxis
:
ylabel
=
"
Absolute [au]
"
if
"
re
"
in
kat
.
yaxis
:
ylabel
=
"
Real part [au]
"
if
y2label
is
None
:
if
"
deg
"
in
kat
.
yaxis
:
y2label
=
"
Phase [deg]
"
if
"
im
"
in
kat
.
yaxis
:
y2label
=
"
Imaginary part [au]
"
else
:
if
ylabel
is
None
:
ylabel
=
"
[au]
"
font_label_size
=
pyplot
.
rcParams
[
"
font.size
"
]
-
1
if
dual_plot
:
if
dual_plot
:
ax
=
pyplot
.
subplot
(
2
,
1
,
1
)
ax
=
pyplot
.
subplot
(
2
,
1
,
1
)
pyplot
.
xlabel
(
self
.
xlabel
,
fontsize
=
pyplot
.
rcParams
[
"
font.
size
"
]
)
pyplot
.
xlabel
(
xlabel
,
fontsize
=
font_label_
size
)
pyplot
.
xlim
(
self
.
x
.
min
(),
self
.
x
.
max
())
pyplot
.
xlim
(
self
.
x
.
min
(),
self
.
x
.
max
())
if
title
is
not
None
:
pyplot
.
title
(
title
,
fontsize
=
pyplot
.
rcParams
[
"
font.size
"
]
-
1
)
pyplot
.
ylabel
(
ylabel
,
fontsize
=
font_label_size
)
if
"
abs
"
in
kat
.
yaxis
:
pyplot
.
ylabel
(
"
Absolute [au]
"
,
fontsize
=
pyplot
.
rcParams
[
"
font.size
"
])
if
title
is
not
None
:
if
"
re
"
in
kat
.
yaxis
:
pyplot
.
ylabel
(
"
Real part [au]
"
,
fontsize
=
pyplot
.
rcParams
[
"
font.
size
"
]
)
pyplot
.
title
(
title
,
fontsize
=
font_label_
size
)
pyplot
.
subplot
(
2
,
1
,
2
)
pyplot
.
subplot
(
2
,
1
,
2
)
pyplot
.
xlabel
(
self
.
xlabel
,
fontsize
=
pyplot
.
rcParams
[
"
font.
size
"
]
)
pyplot
.
xlabel
(
x
2
label
,
fontsize
=
font_label_
size
)
pyplot
.
xlim
(
self
.
x
.
min
(),
self
.
x
.
max
())
pyplot
.
xlim
(
self
.
x
.
min
(),
self
.
x
.
max
())
pyplot
.
ylabel
(
y2label
,
fontsize
=
font_label_size
)
if
"
deg
"
in
kat
.
yaxis
:
pyplot
.
ylabel
(
"
Phase [deg]
"
,
fontsize
=
pyplot
.
rcParams
[
"
font.size
"
])
if
"
im
"
in
kat
.
yaxis
:
pyplot
.
ylabel
(
"
Imaginary part [au]
"
,
fontsize
=
pyplot
.
rcParams
[
"
font.size
"
])
else
:
else
:
pyplot
.
xlabel
(
self
.
xlabel
,
fontsize
=
pyplot
.
rcParams
[
"
font.
size
"
]
)
pyplot
.
xlabel
(
xlabel
,
fontsize
=
font_label_
size
)
pyplot
.
ylabel
(
"
[au]
"
)
pyplot
.
ylabel
(
ylabel
)
pyplot
.
xlim
(
self
.
x
.
min
(),
self
.
x
.
max
())
pyplot
.
xlim
(
self
.
x
.
min
(),
self
.
x
.
max
())
if
title
is
not
None
:
pyplot
.
title
(
title
,
fontsize
=
pyplot
.
rcParams
[
"
font.size
"
]
-
1
)
if
title
is
not
None
:
pyplot
.
title
(
title
,
fontsize
=
font_label_size
)
pyplot
.
tight_layout
()
pyplot
.
tight_layout
()
if
legend
:
if
legend
:
fig
.
axes
[
0
].
legend
(
loc
=
loc
,
fontsize
=
pyplot
.
rcParams
[
"
font.size
"
]
-
1
)
fig
.
axes
[
0
].
legend
(
loc
=
loc
,
fontsize
=
font_label_size
)
if
filename
is
not
None
:
if
filename
is
not
None
:
fig
.
savefig
(
filename
)
fig
.
savefig
(
filename
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment