Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
kwant
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joseph Weston
kwant
Commits
767b24bf
Commit
767b24bf
authored
11 years ago
by
Joseph Weston
Committed by
Christoph Groth
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added vmin and vmax to kwant.plotter.map
parent
f86bcbfd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kwant/plotter.py
+9
-2
9 additions, 2 deletions
kwant/plotter.py
with
9 additions
and
2 deletions
kwant/plotter.py
+
9
−
2
View file @
767b24bf
...
...
@@ -776,7 +776,7 @@ def mask_interpolate(coords, values, a=None, method='nearest', oversampling=3):
return
np
.
ma
.
masked_array
(
img
,
mask
),
cmin
,
cmax
def
map
(
sys
,
value
,
colorbar
=
True
,
cmap
=
None
,
def
map
(
sys
,
value
,
colorbar
=
True
,
cmap
=
None
,
vmin
=
None
,
vmax
=
None
,
a
=
None
,
method
=
'
nearest
'
,
oversampling
=
3
,
file
=
None
,
show
=
True
,
dpi
=
None
,
fig_size
=
None
):
"""
Show interpolated map of a function defined for the sites of a system.
...
...
@@ -798,6 +798,12 @@ def map(sys, value, colorbar=True, cmap=None,
cmap : `matplotlib` color map or `None`
The color map used for sites and optionally hoppings, if `None`,
`matplotlib` default is used.
vmin : float, optional
The lower saturation limit for the colormap; values returned by
`value` which are smaller than this will saturate
vmax : float, optional
The upper saturation limit for the colormap; valued returned by
`value` which are larger than this will saturate
a : float, optional
Reference length. If not given, it is determined as a typical
nearest neighbor distance.
...
...
@@ -848,7 +854,8 @@ def map(sys, value, colorbar=True, cmap=None,
# Note that we tell imshow to show the array created by mask_interpolate
# faithfully and not to interpolate by itself another time.
image
=
ax
.
imshow
(
img
.
T
,
extent
=
(
min
[
0
],
max
[
0
],
min
[
1
],
max
[
1
]),
origin
=
'
lower
'
,
interpolation
=
'
none
'
,
cmap
=
cmap
)
origin
=
'
lower
'
,
interpolation
=
'
none
'
,
cmap
=
cmap
,
vmin
=
vmin
,
vmax
=
vmax
)
if
colorbar
:
fig
.
colorbar
(
image
)
return
output_fig
(
fig
,
file
=
file
,
show
=
show
)
...
...
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