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
finesse
pykat
Commits
377585ad
Commit
377585ad
authored
May 22, 2014
by
Andreas Freise
Browse files
tweaking the tools.py again.
parent
362f549d
Changes
1
Hide whitespace changes
Inline
Side-by-side
pykat/utilities/plotting/tools.py
View file @
377585ad
...
...
@@ -18,6 +18,10 @@ formatter = matplotlib.ticker.EngFormatter(unit='', places=0)
formatter
.
ENG_PREFIXES
[
-
6
]
=
'u'
def
argmaxM
(
data
):
return
(
np
.
unravel_index
(
np
.
argmax
(
data
),
data
.
shape
))
def
printPDF
(
fig
,
filename
):
if
filename
!=
''
and
filename
!=
None
:
if
not
filename
.
lower
().
endswith
((
'.pdf'
)):
...
...
@@ -29,11 +33,12 @@ def printPDF(fig, filename):
def
plot_power_contour
(
x
,
y
,
z
,
xlabel
,
ylabel
,
clabel
,
title
=
''
,
filename
=
''
):
ax
,
fig
=
plot_setup
()
xm
,
ym
=
np
.
meshgrid
(
x
,
y
)
extent
=
[
x
[
0
],
x
[
-
1
],
y
[
0
],
y
[
-
1
]
]
extent
=
[
x
[
0
],
x
[
-
1
],
y
[
0
],
y
[
-
1
]]
mycm
=
'YlOrRd_r'
mycm
=
'hot'
#
mycm='hot'
#im = ax.imshow(z,origin='lower',extent=extent,cmap=mycm, aspect='auto', interpolation='nearest')
im
=
ax
.
imshow
(
z
,
origin
=
'lower'
,
extent
=
extent
,
cmap
=
mycm
,
aspect
=
'auto'
)
#im = ax.imshow(z,origin='lower',cmap=mycm, aspect='auto')
cb
=
fig
.
colorbar
(
im
,
format
=
"%.4g"
)
#cb.set_clim(-1.0*zlimit, zlimit)
ax
.
autoscale
(
False
)
...
...
@@ -45,10 +50,12 @@ def plot_power_contour(x,y,z,xlabel, ylabel, clabel, title='', filename=''):
ax
.
xaxis
.
set_major_formatter
(
formatter
)
ax
.
yaxis
.
set_major_formatter
(
formatter
)
fig
.
canvas
.
manager
.
set_window_title
(
title
)
plt
.
show
()
plt
.
show
(
block
=
0
)
printPDF
(
fig
,
filename
)
def
plot_error_contour
(
x
,
y
,
z
,
xlabel
,
ylabel
,
clabel
,
title
=
''
,
filename
=
''
):
global
fig
,
ax
,
cb
,
ct
,
data
rc
(
'font'
,
**
pp
.
font
)
...
...
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