File: pymatgen.vis.html

package info (click to toggle)
pymatgen 2025.2.18%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 85,888 kB
  • sloc: python: 176,173; javascript: 780; makefile: 221; sh: 78
file content (796 lines) | stat: -rw-r--r-- 84,811 bytes parent folder | download
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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796


<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
  <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>pymatgen.vis package &mdash; pymatgen 2025.1.24 documentation</title>
      <link rel="stylesheet" type="text/css" href="assets/pygments.css?v=fa44fd50" />
      <link rel="stylesheet" type="text/css" href="assets/css/theme.css?v=e59714d7" />
      <link rel="stylesheet" type="text/css" href="assets/css/custom.css" />

  
    <link rel="canonical" href="https://pymatgen.orgpymatgen.vis.html"/>
      <script src="assets/jquery.js?v=5d32c60e"></script>
      <script src="assets/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
      <script src="assets/documentation_options.js?v=d2bc030c"></script>
      <script src="assets/doctools.js?v=9bcbadda"></script>
      <script src="assets/sphinx_highlight.js?v=dc90522c"></script>
    <script src="assets/js/theme.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: linear-gradient(0deg, rgba(23,63,162,1) 0%, rgba(0,70,192,1) 100%)" >

          
          
          <a href="index.html">
            
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <!-- Local TOC -->
              <div class="local-toc"><ul>
<li><a class="reference internal" href="#">pymatgen.vis package</a><ul>
<li><a class="reference internal" href="#submodules">Submodules</a></li>
<li><a class="reference internal" href="#module-pymatgen.vis.plotters">pymatgen.vis.plotters module</a><ul>
<li><a class="reference internal" href="#pymatgen.vis.plotters.SpectrumPlotter"><code class="docutils literal notranslate"><span class="pre">SpectrumPlotter</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.vis.plotters.SpectrumPlotter.add_spectra"><code class="docutils literal notranslate"><span class="pre">SpectrumPlotter.add_spectra()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.plotters.SpectrumPlotter.add_spectrum"><code class="docutils literal notranslate"><span class="pre">SpectrumPlotter.add_spectrum()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.plotters.SpectrumPlotter.get_plot"><code class="docutils literal notranslate"><span class="pre">SpectrumPlotter.get_plot()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.plotters.SpectrumPlotter.save_plot"><code class="docutils literal notranslate"><span class="pre">SpectrumPlotter.save_plot()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.plotters.SpectrumPlotter.show"><code class="docutils literal notranslate"><span class="pre">SpectrumPlotter.show()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#module-pymatgen.vis.structure_chemview">pymatgen.vis.structure_chemview module</a><ul>
<li><a class="reference internal" href="#pymatgen.vis.structure_chemview.quick_view"><code class="docutils literal notranslate"><span class="pre">quick_view()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#module-pymatgen.vis.structure_vtk">pymatgen.vis.structure_vtk module</a><ul>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.MultiStructuresInteractorStyle"><code class="docutils literal notranslate"><span class="pre">MultiStructuresInteractorStyle</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.MultiStructuresInteractorStyle.keyPressEvent"><code class="docutils literal notranslate"><span class="pre">MultiStructuresInteractorStyle.keyPressEvent()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.MultiStructuresVis"><code class="docutils literal notranslate"><span class="pre">MultiStructuresVis</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.DEFAULT_ANIMATED_MOVIE_OPTIONS"><code class="docutils literal notranslate"><span class="pre">MultiStructuresVis.DEFAULT_ANIMATED_MOVIE_OPTIONS</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.apply_tags"><code class="docutils literal notranslate"><span class="pre">MultiStructuresVis.apply_tags()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.display_help"><code class="docutils literal notranslate"><span class="pre">MultiStructuresVis.display_help()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.display_info"><code class="docutils literal notranslate"><span class="pre">MultiStructuresVis.display_info()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.display_warning"><code class="docutils literal notranslate"><span class="pre">MultiStructuresVis.display_warning()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.erase_info"><code class="docutils literal notranslate"><span class="pre">MultiStructuresVis.erase_info()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.erase_warning"><code class="docutils literal notranslate"><span class="pre">MultiStructuresVis.erase_warning()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.set_animated_movie_options"><code class="docutils literal notranslate"><span class="pre">MultiStructuresVis.set_animated_movie_options()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.set_structure"><code class="docutils literal notranslate"><span class="pre">MultiStructuresVis.set_structure()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.set_structures"><code class="docutils literal notranslate"><span class="pre">MultiStructuresVis.set_structures()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureInteractorStyle"><code class="docutils literal notranslate"><span class="pre">StructureInteractorStyle</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureInteractorStyle.keyPressEvent"><code class="docutils literal notranslate"><span class="pre">StructureInteractorStyle.keyPressEvent()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureInteractorStyle.leftButtonPressEvent"><code class="docutils literal notranslate"><span class="pre">StructureInteractorStyle.leftButtonPressEvent()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureInteractorStyle.leftButtonReleaseEvent"><code class="docutils literal notranslate"><span class="pre">StructureInteractorStyle.leftButtonReleaseEvent()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureInteractorStyle.mouseMoveEvent"><code class="docutils literal notranslate"><span class="pre">StructureInteractorStyle.mouseMoveEvent()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis"><code class="docutils literal notranslate"><span class="pre">StructureVis</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.add_bonds"><code class="docutils literal notranslate"><span class="pre">StructureVis.add_bonds()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.add_edges"><code class="docutils literal notranslate"><span class="pre">StructureVis.add_edges()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.add_faces"><code class="docutils literal notranslate"><span class="pre">StructureVis.add_faces()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.add_line"><code class="docutils literal notranslate"><span class="pre">StructureVis.add_line()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.add_partial_sphere"><code class="docutils literal notranslate"><span class="pre">StructureVis.add_partial_sphere()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.add_picker"><code class="docutils literal notranslate"><span class="pre">StructureVis.add_picker()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.add_picker_fixed"><code class="docutils literal notranslate"><span class="pre">StructureVis.add_picker_fixed()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.add_polyhedron"><code class="docutils literal notranslate"><span class="pre">StructureVis.add_polyhedron()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.add_site"><code class="docutils literal notranslate"><span class="pre">StructureVis.add_site()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.add_text"><code class="docutils literal notranslate"><span class="pre">StructureVis.add_text()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.add_triangle"><code class="docutils literal notranslate"><span class="pre">StructureVis.add_triangle()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.display_help"><code class="docutils literal notranslate"><span class="pre">StructureVis.display_help()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.orthogonalize_structure"><code class="docutils literal notranslate"><span class="pre">StructureVis.orthogonalize_structure()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.redraw"><code class="docutils literal notranslate"><span class="pre">StructureVis.redraw()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.rotate_view"><code class="docutils literal notranslate"><span class="pre">StructureVis.rotate_view()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.set_structure"><code class="docutils literal notranslate"><span class="pre">StructureVis.set_structure()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.show"><code class="docutils literal notranslate"><span class="pre">StructureVis.show()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.write_image"><code class="docutils literal notranslate"><span class="pre">StructureVis.write_image()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis.zoom"><code class="docutils literal notranslate"><span class="pre">StructureVis.zoom()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#pymatgen.vis.structure_vtk.make_movie"><code class="docutils literal notranslate"><span class="pre">make_movie()</span></code></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu"  style="background: linear-gradient(0deg, rgba(23,63,162,1) 0%, rgba(0,70,192,1) 100%)" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">pymatgen</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content style-external-links">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
      <li class="breadcrumb-item active">pymatgen.vis package</li>
      <li class="wy-breadcrumbs-aside">
              <a href="https://github.com/materialsproject/pymatgen/blob/master/docs_rst/pymatgen.vis.rst" class="fa fa-github"> Edit on GitHub</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="module-pymatgen.vis">
<span id="pymatgen-vis-package"></span><h1>pymatgen.vis package<a class="headerlink" href="#module-pymatgen.vis" title="Link to this heading"></a></h1>
<p>The vis package implements various visualization tools. For example, a VTK
Structure viewer.</p>
<section id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Link to this heading"></a></h2>
</section>
<section id="module-pymatgen.vis.plotters">
<span id="pymatgen-vis-plotters-module"></span><h2>pymatgen.vis.plotters module<a class="headerlink" href="#module-pymatgen.vis.plotters" title="Link to this heading"></a></h2>
<p>This module defines generic plotters.</p>
<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.vis.plotters.SpectrumPlotter">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">SpectrumPlotter</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xshift</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">yshift</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stack</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color_cycle</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">('qualitative',</span> <span class="pre">'Set1_9')</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/plotters.py#L12-L141"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.plotters.SpectrumPlotter" title="Link 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>Plot Spectrum objects and subclasses.</p>
<p>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>
<blockquote>
<div><p># Initializes plotter with some optional args. Defaults are usually
# fine,
plotter = SpectrumPlotter()</p>
<p># Adds a DOS (A kind of spectra) with a label.
plotter.add_spectrum(“Total DOS”, dos)</p>
<p># Alternatively, you can add a dict of DOSs. This is the typical
# form returned by CompleteDos.get_spd/element/others_dos().
plotter.add_spectra({“dos1”: dos1, “dos2”: dos2})</p>
</div></blockquote>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></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="py method">
<dt class="sig sig-object py" id="pymatgen.vis.plotters.SpectrumPlotter.add_spectra">
<span class="sig-name descname"><span class="pre">add_spectra</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">spectra_dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">key_sort_func</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/plotters.py#L72-L83"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.plotters.SpectrumPlotter.add_spectra" title="Link to this definition"></a></dt>
<dd><p>Add a dictionary of Spectrum, with an optional sorting function for the
keys.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>spectra_dict</strong> – dict of {label: Spectrum}</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="py method">
<dt class="sig sig-object py" id="pymatgen.vis.plotters.SpectrumPlotter.add_spectrum">
<span class="sig-name descname"><span class="pre">add_spectrum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">spectrum</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/plotters.py#L55-L70"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.plotters.SpectrumPlotter.add_spectrum" title="Link to this definition"></a></dt>
<dd><p>Adds a Spectrum for plotting.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></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="py method">
<dt class="sig sig-object py" id="pymatgen.vis.plotters.SpectrumPlotter.get_plot">
<span class="sig-name descname"><span class="pre">get_plot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xlim</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ylim</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/plotters.py#L85-L126"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.plotters.SpectrumPlotter.get_plot" title="Link 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<span class="colon">:</span></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="py method">
<dt class="sig sig-object py" id="pymatgen.vis.plotters.SpectrumPlotter.save_plot">
<span class="sig-name descname"><span class="pre">save_plot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/plotters.py#L128-L136"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.plotters.SpectrumPlotter.save_plot" title="Link to this definition"></a></dt>
<dd><p>Save matplotlib plot to a file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filename</strong> (<em>str</em>) – Filename to write to. Must include extension to specify image format.</p></li>
<li><p><strong>kwargs</strong> – passed to get_plot.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.plotters.SpectrumPlotter.show">
<span class="sig-name descname"><span class="pre">show</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/plotters.py#L138-L141"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.plotters.SpectrumPlotter.show" title="Link to this definition"></a></dt>
<dd><p>Show the plot using matplotlib.</p>
</dd></dl>

</dd></dl>

</section>
<section id="module-pymatgen.vis.structure_chemview">
<span id="pymatgen-vis-structure-chemview-module"></span><h2>pymatgen.vis.structure_chemview module<a class="headerlink" href="#module-pymatgen.vis.structure_chemview" title="Link to this heading"></a></h2>
<p>Visualization for structures using chemview.</p>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.vis.structure_chemview.quick_view">
<span class="sig-name descname"><span class="pre">quick_view</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">structure</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bonds</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">conventional</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">transform</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_box</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bond_tol</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stick_radius</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_chemview.py#L20-L117"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_chemview.quick_view" title="Link to this definition"></a></dt>
<dd><p>A function to visualize pymatgen Structure objects in jupyter notebook using chemview package.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> – pymatgen Structure</p></li>
<li><p><strong>bonds</strong> – (bool) visualize bonds. Bonds are found by comparing distances
to added covalent radii of pairs. Defaults to True.</p></li>
<li><p><strong>conventional</strong> – (bool) use conventional cell. Defaults to False.</p></li>
<li><p><strong>transform</strong> – (list) can be used to make supercells with pymatgen.Structure.make_supercell method</p></li>
<li><p><strong>show_box</strong> – (bool) unit cell is shown. Defaults to True.</p></li>
<li><p><strong>bond_tol</strong> – (float) used if bonds=True. Sets the extra distance tolerance when finding bonds.</p></li>
<li><p><strong>stick_radius</strong> – (float) radius of bonds.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A chemview.MolecularViewer object</p>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-pymatgen.vis.structure_vtk">
<span id="pymatgen-vis-structure-vtk-module"></span><h2>pymatgen.vis.structure_vtk module<a class="headerlink" href="#module-pymatgen.vis.structure_vtk" title="Link to this heading"></a></h2>
<p>This module contains classes to wrap Python VTK to make nice molecular plots.</p>
<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.MultiStructuresInteractorStyle">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">MultiStructuresInteractorStyle</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">parent</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L1165-L1227"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.MultiStructuresInteractorStyle" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureInteractorStyle" title="pymatgen.vis.structure_vtk.StructureInteractorStyle"><code class="xref py py-class docutils literal notranslate"><span class="pre">StructureInteractorStyle</span></code></a></p>
<p>Interactor for MultiStructureVis.</p>
<p>Initialize MultiStructuresInteractorStyle.</p>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.MultiStructuresInteractorStyle.keyPressEvent">
<span class="sig-name descname"><span class="pre">keyPressEvent</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">obj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">event</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L1172-L1227"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.MultiStructuresInteractorStyle.keyPressEvent" title="Link to this definition"></a></dt>
<dd><p>Key press event.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.MultiStructuresVis">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">MultiStructuresVis</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element_color_mapping</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_unit_cell</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_bonds</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_polyhedron</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">poly_radii_tol_factor</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_bonding_elements</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">animated_movie_options</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">{'looping_type':</span> <span class="pre">'restart',</span> <span class="pre">'number_of_loops':</span> <span class="pre">1,</span> <span class="pre">'time_between_frames':</span> <span class="pre">0.1,</span> <span class="pre">'time_between_loops':</span> <span class="pre">1.0}</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L909-L1162"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.MultiStructuresVis" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pymatgen.vis.structure_vtk.StructureVis" title="pymatgen.vis.structure_vtk.StructureVis"><code class="xref py py-class docutils literal notranslate"><span class="pre">StructureVis</span></code></a></p>
<p>Visualization for multiple structures.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>element_color_mapping</strong> – Optional color mapping for the elements,
as a dict of {symbol: rgb tuple}. For example, {“Fe”: (255,
123,0), ….} If None is specified, a default based on
Jmol’s color scheme is used.</p></li>
<li><p><strong>show_unit_cell</strong> – Set to False to not show the unit cell
boundaries. Defaults to True.</p></li>
<li><p><strong>show_bonds</strong> – Set to True to show bonds. Defaults to True.</p></li>
<li><p><strong>show_polyhedron</strong> – Set to True to show polyhedrons. Defaults to
False.</p></li>
<li><p><strong>poly_radii_tol_factor</strong> – The polyhedron and bonding code uses the
ionic radii of the elements or species to determine if two
atoms are bonded. This specifies a tolerance scaling factor
such that atoms which are (1 + poly_radii_tol_factor) * sum
of ionic radii apart are still considered as bonded.</p></li>
<li><p><strong>excluded_bonding_elements</strong> – List of atom types to exclude from
bonding determination. Defaults to an empty list. Useful
when trying to visualize a certain atom type in the
framework (e.g., Li in a Li-ion battery cathode material).</p></li>
<li><p><strong>animated_movie_options</strong> (<em>dict</em>) – Options for animated movie.</p></li>
</ul>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.MultiStructuresVis.DEFAULT_ANIMATED_MOVIE_OPTIONS">
<span class="sig-name descname"><span class="pre">DEFAULT_ANIMATED_MOVIE_OPTIONS</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">ClassVar</span><span class="p"><span class="pre">[</span></span><span class="pre">dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{'looping_type':</span> <span class="pre">'restart',</span> <span class="pre">'number_of_loops':</span> <span class="pre">1,</span> <span class="pre">'time_between_frames':</span> <span class="pre">0.1,</span> <span class="pre">'time_between_loops':</span> <span class="pre">1.0}</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/vis/structure_vtk.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.DEFAULT_ANIMATED_MOVIE_OPTIONS" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.MultiStructuresVis.apply_tags">
<span class="sig-name descname"><span class="pre">apply_tags</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L1016-L1075"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.apply_tags" title="Link to this definition"></a></dt>
<dd><p>Apply tags.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.MultiStructuresVis.display_help">
<span class="sig-name descname"><span class="pre">display_help</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L1091-L1110"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.display_help" title="Link to this definition"></a></dt>
<dd><p>Display the help for various keyboard shortcuts.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.MultiStructuresVis.display_info">
<span class="sig-name descname"><span class="pre">display_info</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">info</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L1138-L1158"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.display_info" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>info</strong> (<em>str</em>) – Information.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.MultiStructuresVis.display_warning">
<span class="sig-name descname"><span class="pre">display_warning</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">warning</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L1112-L1132"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.display_warning" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>warning</strong> (<em>str</em>) – Warning.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.MultiStructuresVis.erase_info">
<span class="sig-name descname"><span class="pre">erase_info</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L1160-L1162"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.erase_info" title="Link to this definition"></a></dt>
<dd><p>Erase all info.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.MultiStructuresVis.erase_warning">
<span class="sig-name descname"><span class="pre">erase_warning</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L1134-L1136"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.erase_warning" title="Link to this definition"></a></dt>
<dd><p>Remove warnings.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.MultiStructuresVis.set_animated_movie_options">
<span class="sig-name descname"><span class="pre">set_animated_movie_options</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">animated_movie_options</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L1077-L1089"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.set_animated_movie_options" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>animated_movie_options</strong> (<em>dict</em>) – Options for animated movie.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.MultiStructuresVis.set_structure">
<span class="sig-name descname"><span class="pre">set_structure</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">structure</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><span class="pre">Structure</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">reset_camera</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">to_unit_cell</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L1003-L1014"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.set_structure" title="Link to this definition"></a></dt>
<dd><p>Add a structure to the visualizer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> – structure to visualize</p></li>
<li><p><strong>reset_camera</strong> – Set to True to reset the camera to a default
determined based on the structure.</p></li>
<li><p><strong>to_unit_cell</strong> – Whether or not to fall back sites into the unit cell.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.MultiStructuresVis.set_structures">
<span class="sig-name descname"><span class="pre">set_structures</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">structures</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Sequence</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><span class="pre">Structure</span></a><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tags</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L968-L1001"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.MultiStructuresVis.set_structures" title="Link to this definition"></a></dt>
<dd><p>Add list of structures to the visualizer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structures</strong> (<em>list</em><em>[</em><em>Structures</em><em>]</em>) – structures to be visualized.</p></li>
<li><p><strong>tags</strong> (<em>list</em><em>[</em><em>dict</em><em>]</em>) – List of tags to be applied to the structures.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureInteractorStyle">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">StructureInteractorStyle</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">parent</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L775-L855"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureInteractorStyle" title="Link 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>A custom interactor style for visualizing structures.</p>
<p>Initialize StructureInteractorStyle.</p>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureInteractorStyle.keyPressEvent">
<span class="sig-name descname"><span class="pre">keyPressEvent</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">obj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">_event</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L805-L855"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureInteractorStyle.keyPressEvent" title="Link to this definition"></a></dt>
<dd><p>Key press event.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureInteractorStyle.leftButtonPressEvent">
<span class="sig-name descname"><span class="pre">leftButtonPressEvent</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">obj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">event</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L786-L789"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureInteractorStyle.leftButtonPressEvent" title="Link to this definition"></a></dt>
<dd><p>Left mouse button press event.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureInteractorStyle.leftButtonReleaseEvent">
<span class="sig-name descname"><span class="pre">leftButtonReleaseEvent</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">obj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">event</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L796-L803"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureInteractorStyle.leftButtonReleaseEvent" title="Link to this definition"></a></dt>
<dd><p>Left mouse button release event.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureInteractorStyle.mouseMoveEvent">
<span class="sig-name descname"><span class="pre">mouseMoveEvent</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">obj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">event</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L791-L794"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureInteractorStyle.mouseMoveEvent" title="Link to this definition"></a></dt>
<dd><p>Mouse move event.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">StructureVis</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element_color_mapping</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_unit_cell</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_bonds</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_polyhedron</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">poly_radii_tol_factor</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_bonding_elements</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L35-L772"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis" title="Link 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>Structure visualization using VTK.</p>
<p>Constructs a Structure Visualization.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>element_color_mapping</strong> – Optional color mapping for the elements,
as a dict of {symbol: rgb tuple}. For example, {“Fe”: (255,
123,0), ….} If None is specified, a default based on
Jmol’s color scheme is used.</p></li>
<li><p><strong>show_unit_cell</strong> – Set to False to not show the unit cell
boundaries. Defaults to True.</p></li>
<li><p><strong>show_bonds</strong> – Set to True to show bonds. Defaults to True.</p></li>
<li><p><strong>show_polyhedron</strong> – Set to True to show polyhedrons. Defaults to
False.</p></li>
<li><p><strong>poly_radii_tol_factor</strong> – The polyhedron and bonding code uses the
ionic radii of the elements or species to determine if two
atoms are bonded. This specifies a tolerance scaling factor
such that atoms which are (1 + poly_radii_tol_factor) * sum
of ionic radii apart are still considered as bonded.</p></li>
<li><p><strong>excluded_bonding_elements</strong> – List of atom types to exclude from
bonding determination. Defaults to an empty list. Useful
when trying to visualize a certain atom type in the
framework (e.g., Li in a Li-ion battery cathode material).</p></li>
</ul>
</dd>
</dl>
<dl class="simple">
<dt>Useful keyboard shortcuts implemented.</dt><dd><p>h : Show help
A/a : Increase/decrease cell by one unit vector in a-direction
B/b : Increase/decrease cell by one unit vector in b-direction
C/c : Increase/decrease cell by one unit vector in c-direction
# : Toggle showing of polyhedrons
- : Toggle showing of bonds
[ : Decrease poly_radii_tol_factor by 0.05
] : Increase poly_radii_tol_factor by 0.05
r : Reset camera direction
o : Orthogonalize structure
Up/Down : Rotate view along Up direction by 90 clock/anticlockwise
Left/right : Rotate view along camera direction by 90
clock/anticlockwise</p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.add_bonds">
<span class="sig-name descname"><span class="pre">add_bonds</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">neighbors</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">center</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">opacity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">radius</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L667-L706"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.add_bonds" title="Link to this definition"></a></dt>
<dd><p>Adds bonds for a site.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>neighbors</strong> – Neighbors of the site.</p></li>
<li><p><strong>center</strong> – The site in the center for all bonds.</p></li>
<li><p><strong>color</strong> – Color of the tubes representing the bonds</p></li>
<li><p><strong>opacity</strong> – Opacity of the tubes representing the bonds</p></li>
<li><p><strong>radius</strong> – Radius of tube s representing the bonds</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.add_edges">
<span class="sig-name descname"><span class="pre">add_edges</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">edges</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Sequence</span><span class="p"><span class="pre">[</span></span><span class="pre">Sequence</span><span class="p"><span class="pre">[</span></span><span class="pre">Sequence</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">type</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'line'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">linewidth</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">(0.0,</span> <span class="pre">0.0,</span> <span class="pre">0.0)</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L630-L665"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.add_edges" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>edges</strong> (<em>Sequence</em>) – List of edges. Each edge is a list of two points.</p></li>
<li><p><strong>type</strong> (<em>str</em>) – Type of the edge. Defaults to “line”. Unused.</p></li>
<li><p><strong>linewidth</strong> (<em>float</em>) – Width of the line.</p></li>
<li><p><strong>color</strong> (<em>tuple</em><em>[</em><em>float</em><em>, </em><em>float</em><em>, </em><em>float</em><em>]</em>) – RGB color.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.add_faces">
<span class="sig-name descname"><span class="pre">add_faces</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">faces</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">opacity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.35</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L565-L628"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.add_faces" title="Link to this definition"></a></dt>
<dd><p>Adding face of polygon.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>faces</strong> (<em>list</em>) – Coordinates of the faces.</p></li>
<li><p><strong>color</strong> (<em>tuple</em>) – RGB color.</p></li>
<li><p><strong>opacity</strong> (<em>float</em>) – Opacity</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.add_line">
<span class="sig-name descname"><span class="pre">add_line</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">start</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">end</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">(0.5,</span> <span class="pre">0.5,</span> <span class="pre">0.5)</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">width</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L405-L433"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.add_line" title="Link to this definition"></a></dt>
<dd><p>Adds a line.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>start</strong> – Starting coordinates for line.</p></li>
<li><p><strong>end</strong> – Ending coordinates for line.</p></li>
<li><p><strong>color</strong> – Color for text as RGB. Defaults to grey.</p></li>
<li><p><strong>width</strong> – Width of line. Defaults to 1.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.add_partial_sphere">
<span class="sig-name descname"><span class="pre">add_partial_sphere</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">coords</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">radius</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">start</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">end</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">360</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">opacity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1.0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L355-L382"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.add_partial_sphere" title="Link to this definition"></a></dt>
<dd><p>Adding a partial sphere (to display partial occupancies.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>coords</strong> (<em>NDArray</em>) – Coordinates</p></li>
<li><p><strong>radius</strong> (<em>float</em>) – Radius of sphere</p></li>
<li><p><strong>color</strong> (<em>tuple</em>) – RGB color of sphere</p></li>
<li><p><strong>start</strong> (<em>float</em>) – Starting angle.</p></li>
<li><p><strong>end</strong> (<em>float</em>) – Ending angle.</p></li>
<li><p><strong>opacity</strong> (<em>float</em>) – Opacity.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.add_picker">
<span class="sig-name descname"><span class="pre">add_picker</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L738-L772"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.add_picker" title="Link to this definition"></a></dt>
<dd><p>Create a cell picker.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.add_picker_fixed">
<span class="sig-name descname"><span class="pre">add_picker_fixed</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L708-L736"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.add_picker_fixed" title="Link to this definition"></a></dt>
<dd><p>Create a cell picker.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.add_polyhedron">
<span class="sig-name descname"><span class="pre">add_polyhedron</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">neighbors</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">center</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">opacity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1.0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">draw_edges</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edges_color</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">(0.0,</span> <span class="pre">0.0,</span> <span class="pre">0.0)</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edges_linewidth</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">2</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L435-L498"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.add_polyhedron" title="Link to this definition"></a></dt>
<dd><p>Adds a polyhedron.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>neighbors</strong> – Neighbors of the polyhedron (the vertices).</p></li>
<li><p><strong>center</strong> – The atom in the center of the polyhedron.</p></li>
<li><p><strong>color</strong> – Color for text as RGB.</p></li>
<li><p><strong>opacity</strong> – Opacity of the polyhedron</p></li>
<li><p><strong>draw_edges</strong> – If set to True, the a line will be drawn at each edge</p></li>
<li><p><strong>edges_color</strong> – Color of the line for the edges</p></li>
<li><p><strong>edges_linewidth</strong> – Width of the line drawn for the edges</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.add_site">
<span class="sig-name descname"><span class="pre">add_site</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">site</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L316-L353"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.add_site" title="Link to this definition"></a></dt>
<dd><p>Add a site to the render window. The site is displayed as a sphere, the
color of which is determined based on the element. Partially occupied
sites are displayed as a single element color, though the site info
still shows the partial occupancy.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>site</strong> – Site to add.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.add_text">
<span class="sig-name descname"><span class="pre">add_text</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">coords</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">text</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">(0,</span> <span class="pre">0,</span> <span class="pre">0)</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L384-L403"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.add_text" title="Link to this definition"></a></dt>
<dd><p>Add text at a coordinate.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>coords</strong> – Coordinates to add text at.</p></li>
<li><p><strong>text</strong> – Text to place.</p></li>
<li><p><strong>color</strong> – Color for text as RGB. Defaults to black.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.add_triangle">
<span class="sig-name descname"><span class="pre">add_triangle</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">neighbors</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">center</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">opacity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.4</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">draw_edges</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edges_color</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">(0.0,</span> <span class="pre">0.0,</span> <span class="pre">0.0)</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edges_linewidth</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">2</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L500-L563"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.add_triangle" title="Link to this definition"></a></dt>
<dd><p>Adds a triangular surface between three atoms.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>neighbors</strong> – Atoms between which a triangle will be drawn.</p></li>
<li><p><strong>color</strong> – Color for triangle as RGB.</p></li>
<li><p><strong>center</strong> – The “central atom” of the triangle</p></li>
<li><p><strong>opacity</strong> – opacity of the triangle</p></li>
<li><p><strong>draw_edges</strong> – If set to True, the a line will be drawn at each edge</p></li>
<li><p><strong>edges_color</strong> – Color of the line for the edges</p></li>
<li><p><strong>edges_linewidth</strong> – Width of the line drawn for the edges</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.display_help">
<span class="sig-name descname"><span class="pre">display_help</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L183-L199"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.display_help" title="Link to this definition"></a></dt>
<dd><p>Display the help for various keyboard shortcuts.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.orthogonalize_structure">
<span class="sig-name descname"><span class="pre">orthogonalize_structure</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L177-L181"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.orthogonalize_structure" title="Link to this definition"></a></dt>
<dd><p>Orthogonalize the structure.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.redraw">
<span class="sig-name descname"><span class="pre">redraw</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">reset_camera</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L155-L175"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.redraw" title="Link to this definition"></a></dt>
<dd><p>Redraw the render window.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>reset_camera</strong> – Set to True to reset the camera to a
pre-determined default for each structure. Defaults to False.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.rotate_view">
<span class="sig-name descname"><span class="pre">rotate_view</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">axis_ind</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">angle</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L114-L129"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.rotate_view" title="Link to this definition"></a></dt>
<dd><p>Rotate the camera view.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>axis_ind</strong> – Index of axis to rotate. Defaults to 0, i.e., a-axis.</p></li>
<li><p><strong>angle</strong> – Angle to rotate by. Defaults to 0.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.set_structure">
<span class="sig-name descname"><span class="pre">set_structure</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">structure</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><span class="pre">Structure</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">reset_camera</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">to_unit_cell</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L201-L300"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.set_structure" title="Link to this definition"></a></dt>
<dd><p>Add a structure to the visualizer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> – structure to visualize</p></li>
<li><p><strong>reset_camera</strong> – Set to True to reset the camera to a default
determined based on the structure.</p></li>
<li><p><strong>to_unit_cell</strong> – Whether or not to fall back sites into the unit cell.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.show">
<span class="sig-name descname"><span class="pre">show</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L308-L314"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.show" title="Link to this definition"></a></dt>
<dd><p>Display the visualizer.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.write_image">
<span class="sig-name descname"><span class="pre">write_image</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'image.png'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">magnification</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">image_format</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'png'</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L131-L153"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.write_image" title="Link to this definition"></a></dt>
<dd><p>Save render window to an image.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filename</strong> – file to save to. Defaults to image.png.</p></li>
<li><p><strong>magnification</strong> – Use it to render high res images.</p></li>
<li><p><strong>image_format</strong> – choose between jpeg, png. Defaults to ‘png’.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.StructureVis.zoom">
<span class="sig-name descname"><span class="pre">zoom</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">factor</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L302-L306"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.StructureVis.zoom" title="Link to this definition"></a></dt>
<dd><p>Zoom the camera view by a factor.</p>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.vis.structure_vtk.make_movie">
<span class="sig-name descname"><span class="pre">make_movie</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">structures</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">output_filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'movie.mp4'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">zoom</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1.0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fps</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">20</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bitrate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'10000k'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">quality</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.1.24/src/pymatgen/core/../vis/structure_vtk.py#L858-L906"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.vis.structure_vtk.make_movie" title="Link to this definition"></a></dt>
<dd><p>Generate a movie from a sequence of structures using vtk and ffmpeg.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structures</strong> (<em>[</em><a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a><em>]</em>) – sequence of structures</p></li>
<li><p><strong>output_filename</strong> (<em>str</em>) – filename for structure output. defaults to
movie.mp4</p></li>
<li><p><strong>zoom</strong> (<em>float</em>) – A zoom to be applied to the visualizer. Defaults to 1.0.</p></li>
<li><p><strong>fps</strong> (<em>int</em>) – Frames per second for the movie. Defaults to 20.</p></li>
<li><p><strong>bitrate</strong> (<em>str</em>) – Video bitrate. Defaults to “10000k” (fairly high
quality).</p></li>
<li><p><strong>quality</strong> (<em>int</em>) – A quality scale. Defaults to 1.</p></li>
<li><p><strong>kwargs</strong> – Any kwargs supported by StructureVis to modify the images
generated.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</section>
</section>


           </div>
          </div>
          <footer>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2011, Pymatgen Development Team.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>