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
c34c4dfb
Commit
c34c4dfb
authored
5 years ago
by
Kelvin Loh
Browse files
Options
Downloads
Patches
Plain Diff
Adds a tutorial to use the plotly engine.
parent
21dcb4cf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/source/tutorial/plotting.rst
+23
-0
23 additions, 0 deletions
doc/source/tutorial/plotting.rst
with
23 additions
and
0 deletions
doc/source/tutorial/plotting.rst
+
23
−
0
View file @
c34c4dfb
...
...
@@ -292,6 +292,29 @@ arbitrarily, allowing for a good inspection of the geometry from all sides.
does not properly honor the corresponding arguments. By resizing the plot
window however one can manually adjust the aspect ratio.
If you also have plotly installed, you can now use the plotly engine for all
the plotting functions within Kwant (except streamplots). The way you would do
it is simple, just set the plotter engine to ``plotly`` and then call the
plotting function as you would do with some minor changes (See note below). For
example, from the previous plot, you would need to just do this:
.. jupyter-execute::
kwant.plotter.set_engine('plotly') # Set to plotly engine
kwant.plot(syst)
kwant.plotter.get_engine() # Get the current engine
kwant.plotter.set_engine('matplotlib') # Set to matplotlib engine
.. note::
By default, the engine would be set to matplotlib if both matplotlib and
plotly are installed, and if either are installed, then, the default would
be the one available in your system. Certain attributes such as dpi or
fig_size or ax are not supported.
Also for 3D it is possible to customize the plot. For example, we
can explicitly plot the hoppings as lines, and color sites differently
depending on the sublattice:
...
...
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