Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
astro
astrotools
Commits
72da1380
Commit
72da1380
authored
Sep 03, 2020
by
Marcus Wirtz
Browse files
[skymap] Optimize cbar behavior in scatter() function
parent
900b4a47
Pipeline
#327022
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
astrotools/skymap.py
View file @
72da1380
...
...
@@ -43,11 +43,10 @@ def scatter(v, c=None, cblabel='log$_{10}$(Energy / eV)', opath=None, fig=None,
kwargs
.
setdefault
(
's'
,
8
)
if
'marker'
not
in
kwargs
:
kwargs
.
setdefault
(
'lw'
,
0
)
cbar
=
kwargs
.
pop
(
'cbar'
,
True
)
cbar
=
kwargs
.
pop
(
'cbar'
,
True
)
and
isinstance
(
c
,
(
list
,
tuple
,
np
.
ndarray
))
if
cbar
:
finite
=
np
.
isfinite
(
c
)
vmin
=
kwargs
.
pop
(
'vmin'
,
smart_round
(
np
.
min
(
c
[
finite
]),
upper_border
=
False
))
vmax
=
kwargs
.
pop
(
'vmax'
,
smart_round
(
np
.
max
(
c
[
finite
]),
upper_border
=
True
))
vmin
=
kwargs
.
pop
(
'vmin'
,
smart_round
(
np
.
min
(
c
[
np
.
isfinite
(
c
)]),
upper_border
=
False
))
vmax
=
kwargs
.
pop
(
'vmax'
,
smart_round
(
np
.
max
(
c
[
np
.
isfinite
(
c
)]),
upper_border
=
True
))
step
=
smart_round
((
vmax
-
vmin
)
/
5.
,
order
=
1
)
cticks
=
kwargs
.
pop
(
'cticks'
,
np
.
round
(
np
.
arange
(
vmin
,
vmax
,
step
),
int
(
np
.
round
(
-
np
.
log10
(
step
),
0
))))
clabels
=
kwargs
.
pop
(
'clabels'
,
cticks
)
...
...
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