forked from materialsproject/pymatgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pymatgen.util.plotting.html
326 lines (306 loc) · 17.7 KB
/
pymatgen.util.plotting.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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>pymatgen.util.plotting 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.util.plotting">
<span id="pymatgen-util-plotting-module"></span><h1>pymatgen.util.plotting module<a class="headerlink" href="#module-pymatgen.util.plotting" title="Permalink to this headline">¶</a></h1>
<dl class="function">
<dt id="pymatgen.util.plotting.add_fig_kwargs">
<code class="descname">add_fig_kwargs</code><span class="sig-paren">(</span><em>func</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/util/plotting.html#add_fig_kwargs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.util.plotting.add_fig_kwargs" title="Permalink to this definition">¶</a></dt>
<dd><p>Decorator that adds keyword arguments for functions returning matplotlib
figures.</p>
<p>The function should return either a matplotlib figure or None to signal
some sort of error/unexpected event.
See doc string below for the list of supported options.</p>
</dd></dl>
<dl class="function">
<dt id="pymatgen.util.plotting.format_formula">
<code class="descname">format_formula</code><span class="sig-paren">(</span><em>formula</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/util/plotting.html#format_formula"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.util.plotting.format_formula" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts str of chemical formula into
latex format for labelling purposes</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>formula</strong> (<em>str</em>) – Chemical formula</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pymatgen.util.plotting.get_ax3d_fig_plt">
<code class="descname">get_ax3d_fig_plt</code><span class="sig-paren">(</span><em>ax=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/util/plotting.html#get_ax3d_fig_plt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.util.plotting.get_ax3d_fig_plt" title="Permalink to this definition">¶</a></dt>
<dd><p>Helper function used in plot functions supporting an optional Axes3D
argument. If ax is None, we build the <cite>matplotlib</cite> figure and create the
Axes3D else we return the current active figure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>kwargs</strong> – keyword arguments are passed to plt.figure if ax is not None.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">Axes</span></code> object
figure: matplotlib figure
plt: matplotlib pyplot module.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>ax</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pymatgen.util.plotting.get_ax_fig_plt">
<code class="descname">get_ax_fig_plt</code><span class="sig-paren">(</span><em>ax=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/util/plotting.html#get_ax_fig_plt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.util.plotting.get_ax_fig_plt" title="Permalink to this definition">¶</a></dt>
<dd><p>Helper function used in plot functions supporting an optional Axes argument.
If ax is None, we build the <cite>matplotlib</cite> figure and create the Axes else
we return the current active figure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>kwargs</strong> – keyword arguments are passed to plt.figure if ax is not None.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">Axes</span></code> object
figure: matplotlib figure
plt: matplotlib pyplot module.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>ax</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pymatgen.util.plotting.get_axarray_fig_plt">
<code class="descname">get_axarray_fig_plt</code><span class="sig-paren">(</span><em>ax_array</em>, <em>nrows=1</em>, <em>ncols=1</em>, <em>sharex=False</em>, <em>sharey=False</em>, <em>squeeze=True</em>, <em>subplot_kw=None</em>, <em>gridspec_kw=None</em>, <em>**fig_kw</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/util/plotting.html#get_axarray_fig_plt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.util.plotting.get_axarray_fig_plt" title="Permalink to this definition">¶</a></dt>
<dd><p>Helper function used in plot functions that accept an optional array of Axes
as argument. If ax_array is None, we build the <cite>matplotlib</cite> figure and
create the array of Axes by calling plt.subplots else we return the
current active figure.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Array of <code class="xref py py-class docutils literal notranslate"><span class="pre">Axes</span></code> objects
figure: matplotlib figure
plt: matplotlib pyplot module.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>ax</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pymatgen.util.plotting.periodic_table_heatmap">
<code class="descname">periodic_table_heatmap</code><span class="sig-paren">(</span><em>elemental_data</em>, <em>cbar_label=''</em>, <em>show_plot=False</em>, <em>cmap='YlOrRd'</em>, <em>blank_color='grey'</em>, <em>value_format=None</em>, <em>max_row=9</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/util/plotting.html#periodic_table_heatmap"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.util.plotting.periodic_table_heatmap" title="Permalink to this definition">¶</a></dt>
<dd><p>A static method that generates a heat map overlapped on a periodic table.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>elemental_data</strong> (<em>dict</em>) – A dictionary with the element as a key and a
value assigned to it, e.g. surface energy and frequency, etc.
Elements missing in the elemental_data will be grey by default
in the final table elemental_data={“Fe”: 4.2, “O”: 5.0}.</p></li>
<li><p><strong>cbar_label</strong> (<em>string</em>) – Label of the colorbar. Default is “”.</p></li>
<li><p><strong>figure_name</strong> (<em>string</em>) – Name of the plot (absolute path) being saved
if not None.</p></li>
<li><p><strong>show_plot</strong> (<em>bool</em>) – Whether to show the heatmap. Default is False.</p></li>
<li><p><strong>value_format</strong> (<em>str</em>) – Formatting string to show values. If None, no value
is shown. Example: “%.4f” shows float to four decimals.</p></li>
<li><p><strong>cmap</strong> (<em>string</em>) – Color scheme of the heatmap. Default is ‘coolwarm’.</p></li>
<li><p><strong>blank_color</strong> (<em>string</em>) – Color assigned for the missing elements in
elemental_data. Default is “grey”.</p></li>
<li><p><strong>max_row</strong> (<em>integer</em>) – Maximum number of rows of the periodic table to be
shown. Default is 9, which means the periodic table heat map covers
the first 9 rows of elements.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pymatgen.util.plotting.pretty_plot">
<code class="descname">pretty_plot</code><span class="sig-paren">(</span><em>width=8</em>, <em>height=None</em>, <em>plt=None</em>, <em>dpi=None</em>, <em>color_cycle=('qualitative'</em>, <em>'Set1_9')</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/util/plotting.html#pretty_plot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.util.plotting.pretty_plot" title="Permalink to this definition">¶</a></dt>
<dd><p>Provides a publication quality plot, with nice defaults for font sizes etc.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>width</strong> (<em>float</em>) – Width of plot in inches. Defaults to 8in.</p></li>
<li><p><strong>height</strong> (<em>float</em>) – Height of plot in inches. Defaults to width * golden
ratio.</p></li>
<li><p><strong>plt</strong> (<em>matplotlib.pyplot</em>) – If plt is supplied, changes will be made to an
existing plot. Otherwise, a new plot will be created.</p></li>
<li><p><strong>dpi</strong> (<em>int</em>) – Sets dot per inch for figure. Defaults to 300.</p></li>
<li><p><strong>color_cycle</strong> (<em>tuple</em>) – Set the color cycle for new plots to one of the
color sets in palettable. Defaults to a qualitative Set1_9.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Matplotlib plot object with properly sized fonts.</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pymatgen.util.plotting.pretty_plot_two_axis">
<code class="descname">pretty_plot_two_axis</code><span class="sig-paren">(</span><em>x</em>, <em>y1</em>, <em>y2</em>, <em>xlabel=None</em>, <em>y1label=None</em>, <em>y2label=None</em>, <em>width=8</em>, <em>height=None</em>, <em>dpi=300</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/util/plotting.html#pretty_plot_two_axis"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.util.plotting.pretty_plot_two_axis" title="Permalink to this definition">¶</a></dt>
<dd><p>Variant of pretty_plot that does a dual axis plot. Adapted from matplotlib
examples. Makes it easier to create plots with different axes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<em>np.ndarray/list</em>) – Data for x-axis.</p></li>
<li><p><strong>y1</strong> (<em>dict/np.ndarray/list</em>) – Data for y1 axis (left). If a dict, it will
be interpreted as a {label: sequence}.</p></li>
<li><p><strong>y2</strong> (<em>dict/np.ndarray/list</em>) – Data for y2 axis (right). If a dict, it will
be interpreted as a {label: sequence}.</p></li>
<li><p><strong>xlabel</strong> (<em>str</em>) – If not None, this will be the label for the x-axis.</p></li>
<li><p><strong>y1label</strong> (<em>str</em>) – If not None, this will be the label for the y1-axis.</p></li>
<li><p><strong>y2label</strong> (<em>str</em>) – If not None, this will be the label for the y2-axis.</p></li>
<li><p><strong>width</strong> (<em>float</em>) – Width of plot in inches. Defaults to 8in.</p></li>
<li><p><strong>height</strong> (<em>float</em>) – Height of plot in inches. Defaults to width * golden
ratio.</p></li>
<li><p><strong>dpi</strong> (<em>int</em>) – Sets dot per inch for figure. Defaults to 300.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>matplotlib.pyplot</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pymatgen.util.plotting.pretty_polyfit_plot">
<code class="descname">pretty_polyfit_plot</code><span class="sig-paren">(</span><em>x</em>, <em>y</em>, <em>deg=1</em>, <em>xlabel=None</em>, <em>ylabel=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/util/plotting.html#pretty_polyfit_plot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.util.plotting.pretty_polyfit_plot" title="Permalink to this definition">¶</a></dt>
<dd><p>Convenience method to plot data with trend lines based on polynomial fit.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> – Sequence of x data.</p></li>
<li><p><strong>y</strong> – Sequence of y data.</p></li>
<li><p><strong>deg</strong> (<em>int</em>) – Degree of polynomial. Defaults to 1.</p></li>
<li><p><strong>xlabel</strong> (<em>str</em>) – Label for x-axis.</p></li>
<li><p><strong>ylabel</strong> (<em>str</em>) – Label for y-axis.</p></li>
<li><p><strong>**kwargs</strong> – Keyword args passed to pretty_plot.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>matplotlib.pyplot object.</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pymatgen.util.plotting.van_arkel_triangle">
<code class="descname">van_arkel_triangle</code><span class="sig-paren">(</span><em>list_of_materials</em>, <em>annotate=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/util/plotting.html#van_arkel_triangle"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.util.plotting.van_arkel_triangle" title="Permalink to this definition">¶</a></dt>
<dd><dl>
<dt>A static method that generates a binary van Arkel-Ketelaar triangle to</dt><dd><p>quantify the ionic, metallic and covalent character of a compound
by plotting the electronegativity difference (y) vs average (x).
See:</p>
<blockquote>
<div><dl class="simple">
<dt>A.E. van Arkel, Molecules and Crystals in Inorganic Chemistry,</dt><dd><p>Interscience, New York (1956)</p>
</dd>
</dl>
</div></blockquote>
<dl class="simple">
<dt>and</dt><dd><dl class="simple">
<dt>J.A.A Ketelaar, Chemical Constitution (2nd edn.), An Introduction</dt><dd><p>to the Theory of the Chemical Bond, Elsevier, New York (1958)</p>
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>list_of_materials</strong> (<em>list</em>) – A list of computed entries of binary
materials or a list of lists containing two elements (str).</p></li>
<li><p><strong>annotate</strong> (<em>bool</em>) – Whether or not to lable the points on the
triangle with reduced formula (if list of entries) or pair
of elements (if list of list of str).</p></li>
</ul>
</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.util.plotting.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>