Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gregory Ashton
PyFstat
Commits
8f27fc99
Commit
8f27fc99
authored
Oct 19, 2016
by
Gregory Ashton
Browse files
Add functionality to plot the mismatch in the grid search
parent
c03b0a03
Changes
1
Hide whitespace changes
Inline
Side-by-side
pyfstat.py
View file @
8f27fc99
...
...
@@ -1607,7 +1607,8 @@ class GridSearch(BaseSearchClass):
def
plot_2D
(
self
,
xkey
,
ykey
,
ax
=
None
,
save
=
True
,
vmin
=
None
,
vmax
=
None
,
add_mismatch
=
None
,
xN
=
None
,
yN
=
None
,
flat_keys
=
[],
rel_flat_idxs
=
[],
flatten_method
=
np
.
max
):
rel_flat_idxs
=
[],
flatten_method
=
np
.
max
,
predicted_twoF
=
None
,
cm
=
None
):
""" Plots a 2D grid of 2F values
Parameters
...
...
@@ -1636,7 +1637,15 @@ class GridSearch(BaseSearchClass):
if
len
(
rel_flat_idxs
)
>
0
:
Z
=
flatten_method
(
Z
,
axis
=
tuple
(
rel_flat_idxs
))
pax
=
ax
.
pcolormesh
(
X
,
Y
,
Z
,
cmap
=
plt
.
cm
.
viridis
,
vmin
=
vmin
,
vmax
=
vmax
)
if
predicted_twoF
:
Z
=
(
predicted_twoF
-
Z
)
/
(
predicted_twoF
+
4
)
if
cm
is
None
:
cm
=
plt
.
cm
.
viridis_r
else
:
if
cm
is
None
:
cm
=
plt
.
cm
.
viridis
pax
=
ax
.
pcolormesh
(
X
,
Y
,
Z
,
cmap
=
cm
,
vmin
=
vmin
,
vmax
=
vmax
)
plt
.
colorbar
(
pax
,
ax
=
ax
)
if
add_mismatch
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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