Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pablo Piskunow
kwant
Commits
dd3e879f
Commit
dd3e879f
authored
Jun 27, 2014
by
Michael Wimmer
Committed by
Christoph Groth
Jul 01, 2014
Browse files
allow any sequence with two entries for cmap
parent
9c8b1e6f
Changes
1
Show whitespace changes
Inline
Side-by-side
kwant/plotter.py
View file @
dd3e879f
...
...
@@ -1044,7 +1044,7 @@ def plot(sys, num_lead_cells=2, unit='nn',
Linewidth of the lead symbols.
lead_hop_lw : number or `None`
Linewidth of the lead hoppings.
cmap : `matplotlib` color map or a
tupl
e of two color maps or `None`
cmap : `matplotlib` color map or a
sequenc
e of two color maps or `None`
The color map used for sites and optionally hoppings.
pos_transform : function or `None`
Transformation to be applied to the site position.
...
...
@@ -1272,11 +1272,16 @@ def plot(sys, num_lead_cells=2, unit='nn',
lead_hop_lw
=
(
hop_lw
if
not
isarray
(
hop_lw
)
else
defaults
[
'hop_lw'
][
dim
])
if
isinstance
(
cmap
,
tuple
):
hop_cmap
=
None
if
not
isinstance
(
cmap
,
basestring
):
try
:
if
len
(
cmap
)
!=
2
:
raise
ValueError
(
"if cmap is a sequence, it must have exactly "
"two entries"
)
hop_cmap
=
cmap
[
1
]
cmap
=
cmap
[
0
]
e
lse
:
hop_cmap
=
None
e
xcept
(
TypeError
,
KeyError
)
:
pass
# make a new figure unless axes specified
if
not
ax
:
...
...
Write
Preview
Supports
Markdown
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