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
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Michael Wimmer
kwant
Commits
fd119772
Commit
fd119772
authored
11 years ago
by
Michael Wimmer
Committed by
Christoph Groth
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
avoid intermediate conversion to and from numpy array
parent
0674f999
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kwant/plotter.py
+3
-3
3 additions, 3 deletions
kwant/plotter.py
with
3 additions
and
3 deletions
kwant/plotter.py
+
3
−
3
View file @
fd119772
...
...
@@ -246,14 +246,14 @@ if has3d:
return
Affine2D
().
scale
(
self
.
figure
.
dpi
/
72.0
)
def
do_3d_projection
(
self
,
renderer
):
rs
=
np
.
array
(
self
.
_offsets3d
)
xs
,
ys
,
zs
=
self
.
_offsets3d
# numpy complains about zero-length index arrays
if
rs
.
shape
[
1
]
==
0
:
if
len
(
xs
)
==
0
:
return
-
self
.
_zorder3d
proj
=
mplot3d
.
proj3d
.
proj_transform_clip
vs
=
np
.
array
(
proj
(
*
(
list
(
rs
)
+
[
renderer
.
M
])
)[:
3
])
vs
=
np
.
array
(
proj
(
xs
,
ys
,
zs
,
renderer
.
M
)[:
3
])
if
_sort3d
:
indx
=
vs
[
2
].
argsort
()[::
-
1
]
...
...
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