forked from materialsproject/pymatgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pymatgen.vis.plotters.html
214 lines (196 loc) · 11.2 KB
/
pymatgen.vis.plotters.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>pymatgen.vis.plotters module — pymatgen 2019.5.1 documentation</title>
<link rel="stylesheet" href="_static/proBlue.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-33990148-1']);
_gaq.push(['_trackPageview']);
</script>
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pymatgen 2019.5.1 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-pymatgen.vis.plotters">
<span id="pymatgen-vis-plotters-module"></span><h1>pymatgen.vis.plotters module<a class="headerlink" href="#module-pymatgen.vis.plotters" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="pymatgen.vis.plotters.SpectrumPlotter">
<em class="property">class </em><code class="descname">SpectrumPlotter</code><span class="sig-paren">(</span><em>xshift=0.0</em>, <em>yshift=0.0</em>, <em>stack=False</em>, <em>color_cycle=('qualitative'</em>, <em>'Set1_9')</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/vis/plotters.html#SpectrumPlotter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.vis.plotters.SpectrumPlotter" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Class for plotting Spectrum objects and subclasses. Note that the interface
is extremely flexible given that there are many different ways in which
people want to view spectra. The typical usage is:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Initializes plotter with some optional args. Defaults are usually</span>
<span class="c1"># fine,</span>
<span class="n">plotter</span> <span class="o">=</span> <span class="n">SpectrumPlotter</span><span class="p">()</span>
<span class="c1"># Adds a DOS (A kind of spectra) with a label.</span>
<span class="n">plotter</span><span class="o">.</span><span class="n">add_spectrum</span><span class="p">(</span><span class="s2">"Total DOS"</span><span class="p">,</span> <span class="n">dos</span><span class="p">)</span>
<span class="c1"># Alternatively, you can add a dict of DOSs. This is the typical</span>
<span class="c1"># form returned by CompleteDos.get_spd/element/others_dos().</span>
<span class="n">plotter</span><span class="o">.</span><span class="n">add_spectra</span><span class="p">({</span><span class="s2">"dos1"</span><span class="p">:</span> <span class="n">dos1</span><span class="p">,</span> <span class="s2">"dos2"</span><span class="p">:</span> <span class="n">dos2</span><span class="p">})</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xshift</strong> (<em>float</em>) – A shift that is applied to the x values. This is
commonly used to shift to an arbitrary zero. E.g., zeroing at the
Fermi energy in DOS, or at the absorption edge in XAS spectra. The
same xshift is applied to all spectra.</p></li>
<li><p><strong>yshift</strong> (<em>float</em>) – A shift that is applied to the y values. This is
commonly used to displace spectra for easier visualization.
Successive spectra are applied successive shifts.</p></li>
<li><p><strong>stack</strong> (<em>bool</em>) – Whether to stack plots rather than simply plot them.
For example, DOS plot can usually be stacked to look at the
contribution of each orbital.</p></li>
<li><p><strong>color_cycle</strong> (<em>str</em>) – Default color cycle to use. Note that this can be
overridden</p></li>
</ul>
</dd>
</dl>
<dl class="method">
<dt id="pymatgen.vis.plotters.SpectrumPlotter.add_spectra">
<code class="descname">add_spectra</code><span class="sig-paren">(</span><em>spectra_dict</em>, <em>key_sort_func=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/vis/plotters.html#SpectrumPlotter.add_spectra"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.vis.plotters.SpectrumPlotter.add_spectra" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a dictionary of doses, with an optional sorting function for the
keys.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dos_dict</strong> – dict of {label: Dos}</p></li>
<li><p><strong>key_sort_func</strong> – function used to sort the dos_dict keys.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.vis.plotters.SpectrumPlotter.add_spectrum">
<code class="descname">add_spectrum</code><span class="sig-paren">(</span><em>label</em>, <em>spectrum</em>, <em>color=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/vis/plotters.html#SpectrumPlotter.add_spectrum"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.vis.plotters.SpectrumPlotter.add_spectrum" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds a Spectrum for plotting.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>label</strong> (<em>str</em>) – Label for the Spectrum. Must be unique.</p></li>
<li><p><strong>spectrum</strong> – Spectrum object</p></li>
<li><p><strong>color</strong> (<em>str</em>) – This is passed on to matplotlib. E.g., “k–” indicates
a dashed black line. If None, a color will be chosen based on
the default color cycle.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.vis.plotters.SpectrumPlotter.get_plot">
<code class="descname">get_plot</code><span class="sig-paren">(</span><em>xlim=None</em>, <em>ylim=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/vis/plotters.html#SpectrumPlotter.get_plot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.vis.plotters.SpectrumPlotter.get_plot" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a matplotlib plot showing the DOS.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xlim</strong> – Specifies the x-axis limits. Set to None for automatic
determination.</p></li>
<li><p><strong>ylim</strong> – Specifies the y-axis limits.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.vis.plotters.SpectrumPlotter.save_plot">
<code class="descname">save_plot</code><span class="sig-paren">(</span><em>filename</em>, <em>img_format='eps'</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/vis/plotters.html#SpectrumPlotter.save_plot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.vis.plotters.SpectrumPlotter.save_plot" title="Permalink to this definition">¶</a></dt>
<dd><p>Save matplotlib plot to a file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filename</strong> – Filename to write to.</p></li>
<li><p><strong>img_format</strong> – Image format to use. Defaults to EPS.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.vis.plotters.SpectrumPlotter.show">
<code class="descname">show</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/vis/plotters.html#SpectrumPlotter.show"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.vis.plotters.SpectrumPlotter.show" title="Permalink to this definition">¶</a></dt>
<dd><p>Show the plot using matplotlib.</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/pymatgen.vis.plotters.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pymatgen 2019.5.1 documentation</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2011, Pymatgen Development Team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.0.1.
</div>
<div class="footer">This page uses <a href="http://analytics.google.com/">
Google Analytics</a> to collect statistics. You can disable it by blocking
the JavaScript coming from www.google-analytics.com.
<script type="text/javascript">
(function() {
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ?
'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
})();
</script>
</div>
</body>
</html>