Repository: janosh/pymatviz (language: python)

Issue:
Add `plot_xrd_pattern()` for creating interactive XRD patterns with plotly
output is still a bit rough, esp. with overlapping annotations when plotting multiple XRD patterns into the same figure as below but good enough for a version 1.

![xrd-pattern-multiple](https://github.com/janosh/pymatviz/assets/30958850/4a1549f7-8e3e-4aa8-81a3-a900c28c8a70)



Discussion / hints:

Fix patch:
diff --git a/assets/xrd-pattern-multiple.svg b/assets/xrd-pattern-multiple.svg
index 75715b9e..d6211de2 100644
--- a/assets/xrd-pattern-multiple.svg
+++ b/assets/xrd-pattern-multiple.svg
@@ -1,1 +1,1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="700" height="500" class="main-svg"><path d="M0 0h700v500H0z" style="fill:#fff;fill-opacity:1"/><defs><clipPath id="a" class="plotclip"><path d="M0 0h623v431H0z"/></clipPath></defs><g class="cartesianlayer"><g class="subplot xy"><g class="gridlayer"><g class="x"><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(131.69)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(197.38)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(263.07)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(328.75)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(394.44)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(460.13)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(525.82)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(591.51)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(657.2)"/></g><g class="y"><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 359.9)"/><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 277.81)"/><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 195.71)"/><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 113.62)"/><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 31.52)"/></g></g><g class="zerolinelayer"><path d="M66 0h623" class="yzl zl crisp" style="stroke:#ebf0f8;stroke-opacity:1;stroke-width:2px" transform="translate(0 442)"/></g><g class="plot" clip-path="url(#a)" transform="translate(66 11)"><g class="barlayer mlayer"><g class="trace bars" style="opacity:1"><g class="points"><path d="M52.65 431V302.11h3.29V431Zm22.56 0v-31.64h3.29V431Zm17.36 0v-70.03h3.28V431Zm14.66 0v-56.84h3.29V431Zm12.96 0v-13.93h3.29V431Zm11.75 0v-19.06h3.28V431Zm20.94 0v-27.35h3.28V431Zm9.52 0v-9.86h3.28V431Zm9.03 0v-10.49h3.28V431Zm8.61 0v-74.83h3.28V431Zm8.25 0V20.52h3.28V431Zm7.94 0v-4.46h3.28V431Zm7.65 0v-13.88h3.29V431Zm14.6 0v-42.99h3.28V431Zm6.98 0v-4.66h3.29V431Zm6.8 0v-7.53h3.29V431Zm6.64 0v-23.43h3.28V431Zm6.48 0v-32.69h3.28V431Zm6.33 0v-4.75H255V431Zm6.21 0v-3.84h3.29V431Zm12.06 0v-13.61h3.28V431Zm5.86 0v-12.79h3.29V431Zm5.77 0v-9.12h3.29V431Zm5.68 0v-30.58h3.28V431Zm11.09 0v-4.52h3.28V431Zm5.42 0v-4.95h3.29V431Zm10.64 0V84.8h3.29V431Zm5.22 0v-10.37h3.29V431Zm5.16 0v-4.12h3.28V431Zm5.1 0v-19.67h3.28V431Zm5.04 0v-17.64h3.28V431Zm4.98 0v-1.05h3.29V431Zm4.94 0v-5.23h3.28V431Zm9.73 0v-6.44h3.28V431Zm4.8 0v-8.83h3.28V431Zm4.75 0v-2.99h3.28V431Zm4.71 0v-11.45h3.29V431Zm4.68 0V245.6h3.28V431Zm4.63 0v-2.32h3.29V431Zm4.61 0v-2.6h3.28v2.6Zm9.1 0v-12.92h3.28V431Zm4.5 0v-3.17h3.29V431Zm4.47 0v-3.99h3.29V431Zm4.45 0v-10.99h3.28V431Zm4.41 0v-8h3.29v8Zm4.39 0v-1.8h3.29v1.8Zm4.37 0v-4.05h3.28V431Zm8.65 0v-7.66h3.29V431Zm4.3 0v-.82h3.28v.82Zm4.27 0v-.91h3.28v.91Zm4.25 0v-21h3.28v21Zm8.44 0v-1.44h3.28V431Zm4.19 0v-3.28h3.29V431Zm8.33 0v-54.16h3.29V431Zm4.15 0v-4.36h3.28V431Zm4.12 0v-2.98h3.29V431Zm4.11 0v-3.6h3.29v3.6Zm4.1 0v-10.6h3.28V431Zm4.08 0v-1.59h3.29V431Zm4.07 0v-1.37h3.29V431Zm8.11 0v-3.95h3.28V431Zm4.03 0v-.57h3.29v.57Zm4.03 0v-3.16h3.28V431Zm4.01 0v-11.44H509V431Zm4 0v-76.53h3.29V431Zm4 0v-1.36H517V431Zm3.98 0v-1.18h3.29V431Zm7.95 0v-18.46h3.29V431Zm3.97 0v-3.29h3.28V431Zm3.95 0v-1.1h3.29v1.1Zm3.95 0v-8.01h3.29V431Zm3.95 0v-7.92h3.28V431Zm3.94 0v-.6h3.28v.6Zm3.93 0v-2.6h3.28v2.6Zm7.86 0v-2.03h3.28V431Zm3.92 0v-5.3h3.28v5.3Zm3.92 0v-2.47h3.28V431Zm3.91 0v-7.69h3.29V431Zm7.83 0v-.54h3.29v.54Zm3.91 0v-1.89h3.29V431Zm7.82 0V311.11h3.29V431Z" class="point" style="vector-effect:none;opacity:1;stroke-width:.5px;fill:#636efa;fill-opacity:1;stroke:#fff;stroke-opacity:1"/></g></g><g class="trace bars" style="opacity:1"><g class="points"><path d="M91.83 431v-58.23h3.28V431Zm59.83 0v-.2h3.28v.2Zm26.94 0v-33.73h3.28V431Zm8.18 0V20.52h3.28V431Zm29.93 0V286.06H220V431Zm20.25 0v-43.08h3.28V431Zm30.81 0v-.71h3.28v.71Zm17.15 0v-22.24h3.29V431Zm26.91 0V236.42h3.28V431Zm15.33 0v-20.39h3.28V431Zm24.45 0v-.19h3.29v.19Zm14.12 0v-5.38h3.29V431Zm4.63 0V244.99h3.29V431Zm18.16 0v-44.76h3.28V431Zm13.28 0v-10.8h3.28V431Zm21.59 0v-.01h3.28v.01Zm12.67 0v-10.56h3.28V431Zm20.73 0v-29.26h3.28V431Zm12.23 0v-7.51h3.29V431Zm20.11 0v-.51h3.28v.51Zm11.92 0v-8.09h3.28V431Zm3.95 0v-76.53h3.29V431Zm15.73 0v-63.26h3.28V431Zm11.71 0v-10.06h3.28V431Zm19.4 0v-.08h3.28v.08Zm11.59 0v-4.9h3.28v4.9Zm19.26 0v-60.05h3.29V431Z" class="point" style="vector-effect:none;opacity:1;stroke-width:.5px;fill:#ef553b;fill-opacity:1;stroke:#fff;stroke-opacity:1"/></g></g></g></g><path d="M65 442.5h625M65 10.5h625" class="xlines-above crisp" style="fill:none;stroke-width:1px;stroke:#000;stroke-opacity:1"/><path d="M65.5 11v431m624-431v431" class="ylines-above crisp" style="fill:none;stroke-width:1px;stroke:#000;stroke-opacity:1"/><g class="xaxislayer-above"><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(66)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(131.69)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(197.38)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(263.07)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(328.75)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(394.44)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(460.13)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(525.82)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(591.51)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(657.2)"/><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(66)">0</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(131.69)">10</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(197.38)">20</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(263.07)">30</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(328.75)">40</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(394.44)">50</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(460.13)">60</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(525.82)">70</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(591.51)">80</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(657.2)">90</text></g><g class="yaxislayer-above"><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 442)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 359.9)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 277.81)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 195.71)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 113.62)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 31.52)"/><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 442)">0</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 359.9)">20</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 277.81)">40</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 195.71)">60</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 113.62)">80</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 31.52)">100</text></g></g></g><defs><clipPath id="b"><path d="M0 0h126v48H0z"/></clipPath></defs><g class="infolayer"><g class="legend" pointer-events="all"><path d="M0 0h126v48H0z" class="bg" shape-rendering="crispEdges" style="stroke:#444;stroke-opacity:1;fill:#fff;fill-opacity:1;stroke-width:0" transform="translate(563 11)"/><g class="scrollbox" clip-path="url(#b)" transform="translate(563 11)"><g class="groups"><g class="traces" style="opacity:1"><text x="40" y="4.68" class="legendtext" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" transform="translate(0 14.5)">Zr8 Bi12 O28</text><g class="layers" style="opacity:1"><g class="legendsymbols"><g class="legendpoints"><path d="M6 6H-6V-6H6Z" class="legendundefined" style="stroke-width:.5px;fill:#636efa;fill-opacity:1;stroke:#fff;stroke-opacity:1" transform="translate(20 14.5)"/></g></g></g><path fill="none" d="M0-9.5h120.891v19H0z" class="legendtoggle" style="fill:#000;fill-opacity:0" transform="translate(0 14.5)"/></g><g class="traces" style="opacity:1"><text x="40" y="4.68" class="legendtext" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" transform="translate(0 33.5)">Zr4 Bi4 O14</text><g class="layers" style="opacity:1"><g class="legendsymbols"><g class="legendpoints"><path d="M6 6H-6V-6H6Z" class="legendundefined" style="stroke-width:.5px;fill:#ef553b;fill-opacity:1;stroke:#fff;stroke-opacity:1" transform="translate(20 33.5)"/></g></g></g><path fill="none" d="M0-9.5h120.891v19H0z" class="legendtoggle" style="fill:#000;fill-opacity:0" transform="translate(0 33.5)"/></g></g></g></g><g class="g-xtitle"><text x="377.5" y="489.206" class="xtitle" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:14px;fill:#000;opacity:1;white-space:pre" text-anchor="middle">2θ (degrees)</text></g><g class="g-ytitle"><text x="15.303" y="226.5" class="ytitle" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:14px;fill:#000;opacity:1;white-space:pre" text-anchor="middle" transform="rotate(-90 15.303 226.5)">Intensity (a.u.)</text></g><g class="annotation" data-index="0" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h114v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(521 268)"/><text x="57.25" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(521 268)"><tspan x="57.25" y="14" class="line" dy="0em">(6, 2, 4), (4, 0, 8)</tspan><tspan x="57.25" y="14" class="line" dy="1.3em">89.84°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m636.16 302.11 20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(44.988 -60.21 951.782)"/></g></g><g class="annotation" data-index="1" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h54v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(140 259)"/><text x="27.484" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(140 259)"><tspan x="27.484" y="14" class="line" dy="0em">(0, 0, 1)</tspan><tspan x="27.484" y="14" class="line" dy="1.3em">8.27°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m140.3 293.11-20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(135 -4.047 181.2)"/></g></g><g class="annotation" data-index="2" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h114v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(461 203)"/><text x="57.25" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(461 203)"><tspan x="57.25" y="14" class="line" dy="0em">(4, 2, 2), (2, 0, 6)</tspan><tspan x="57.25" y="14" class="line" dy="1.3em">57.12°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m461.19 236.6-20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(135 168.101 219.404)"/></g></g><g class="annotation" data-index="3" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h114v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(402 42)"/><text x="57.25" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(402 42)"><tspan x="57.25" y="14" class="line" dy="0em">(4, 0, 0), (2, 2, 4)</tspan><tspan x="57.25" y="14" class="line" dy="1.3em">48.12°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m402.09 75.8-20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(135 171.854 126.764)"/></g></g><g class="annotation" data-index="4" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h54v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(281 18)"/><text x="27.484" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(281 18)"><tspan x="27.484" y="14" class="line" dy="0em">(2, 0, 2)</tspan><tspan x="27.484" y="14" class="line" dy="1.3em">28.91°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m281.43 37.895-25.5-6.375" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,24.9848px,26.2848px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(-165.964 130.555 .087)"/></g></g><g class="annotation" data-index="5" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h179v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(593 311)"/><text x="89.75" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(593 311)"><tspan x="89.75" y="14" class="line" dy="0em">(6, 4, 4), (6, 2, 2), (4, 0, -2)</tspan><tspan x="89.75" y="14" class="line" dy="1.3em">77.13°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m592.65 345.47-20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(135.012 211.307 301.03)"/></g></g><g class="annotation" data-index="6" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h54v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(304 243)"/><text x="27.484" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(304 243)"><tspan x="27.484" y="14" class="line" dy="0em">(2, 2, 0)</tspan><tspan x="27.484" y="14" class="line" dy="1.3em">33.24°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m304.36 277.06-20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(135 81.307 207.154)"/></g></g><g class="annotation" data-index="7" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h179v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(458 202)"/><text x="89.75" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(458 202)"><tspan x="89.75" y="14" class="line" dy="0em">(4, 4, 2), (4, 2, 0), (2, 2, -2)</tspan><tspan x="89.75" y="14" class="line" dy="1.3em">56.63°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m458 235.99-20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(135 166.633 218.439)"/></g></g><g class="annotation" data-index="8" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h119v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(399 193)"/><text x="59.984" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(399 193)"><tspan x="59.984" y="14" class="line" dy="0em">(4, 2, 2), (2, 0, -2)</tspan><tspan x="59.984" y="14" class="line" dy="1.3em">47.72°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m399.47 227.42-20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(135 139.143 202.032)"/></g></g><g class="annotation" data-index="9" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h114v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(219 18)"/><text x="57.25" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(219 18)"><tspan x="57.25" y="14" class="line" dy="0em">(2, 2, 2), (2, 0, 0)</tspan><tspan x="57.25" y="14" class="line" dy="1.3em">28.68°</tspan></text></g></g></g></g></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="700" height="500" class="main-svg"><path d="M0 0h700v500H0z" style="fill:#fff;fill-opacity:1"/><defs><clipPath id="a" class="plotclip"><path d="M0 0h623v431H0z"/></clipPath></defs><g class="cartesianlayer"><g class="subplot xy"><g class="gridlayer"><g class="x"><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(131.69)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(197.38)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(263.07)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(328.75)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(394.44)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(460.13)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(525.82)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(591.51)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(657.2)"/></g><g class="y"><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 359.9)"/><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 277.81)"/><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 195.71)"/><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 113.62)"/><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 31.52)"/></g></g><g class="zerolinelayer"><path d="M66 0h623" class="yzl zl crisp" style="stroke:#ebf0f8;stroke-opacity:1;stroke-width:2px" transform="translate(0 442)"/></g><g class="plot" clip-path="url(#a)" transform="translate(66 11)"><g class="barlayer mlayer"><g class="trace bars" style="opacity:1"><g class="points"><path d="M52.65 431V302.11h3.29V431Zm22.56 0v-31.64h3.29V431Zm17.36 0v-70.03h3.28V431Zm14.66 0v-56.84h3.29V431Zm12.96 0v-13.93h3.29V431Zm11.75 0v-19.06h3.28V431Zm20.94 0v-27.35h3.28V431Zm9.52 0v-9.86h3.28V431Zm9.03 0v-10.49h3.28V431Zm8.61 0v-74.83h3.28V431Zm8.25 0V20.52h3.28V431Zm7.94 0v-4.46h3.28V431Zm7.65 0v-13.88h3.29V431Zm14.6 0v-42.99h3.28V431Zm6.98 0v-4.66h3.29V431Zm6.8 0v-7.53h3.29V431Zm6.64 0v-23.43h3.28V431Zm6.48 0v-32.69h3.28V431Zm6.33 0v-4.75H255V431Zm6.21 0v-3.84h3.29V431Zm12.06 0v-13.61h3.28V431Zm5.86 0v-12.79h3.29V431Zm5.77 0v-9.12h3.29V431Zm5.68 0v-30.58h3.28V431Zm11.09 0v-4.52h3.28V431Zm5.42 0v-4.95h3.29V431Zm10.64 0V84.8h3.29V431Zm5.22 0v-10.37h3.29V431Zm5.16 0v-4.12h3.28V431Zm5.1 0v-19.67h3.28V431Zm5.04 0v-17.64h3.28V431Zm4.98 0v-1.05h3.29V431Zm4.94 0v-5.23h3.28V431Zm9.73 0v-6.44h3.28V431Zm4.8 0v-8.83h3.28V431Zm4.75 0v-2.99h3.28V431Zm4.71 0v-11.45h3.29V431Zm4.68 0V245.6h3.28V431Zm4.63 0v-2.32h3.29V431Zm4.61 0v-2.6h3.28v2.6Zm9.1 0v-12.92h3.28V431Zm4.5 0v-3.17h3.29V431Zm4.47 0v-3.99h3.29V431Zm4.45 0v-10.99h3.28V431Zm4.41 0v-8h3.29v8Zm4.39 0v-1.8h3.29v1.8Zm4.37 0v-4.05h3.28V431Zm8.65 0v-7.66h3.29V431Zm4.3 0v-.82h3.28v.82Zm4.27 0v-.91h3.28v.91Zm4.25 0v-21h3.28v21Zm8.44 0v-1.44h3.28V431Zm4.19 0v-3.28h3.29V431Zm8.33 0v-54.16h3.29V431Zm4.15 0v-4.36h3.28V431Zm4.12 0v-2.98h3.29V431Zm4.11 0v-3.6h3.29v3.6Zm4.1 0v-10.6h3.28V431Zm4.08 0v-1.59h3.29V431Zm4.07 0v-1.37h3.29V431Zm8.11 0v-3.95h3.28V431Zm4.03 0v-.57h3.29v.57Zm4.03 0v-3.16h3.28V431Zm4.01 0v-11.44H509V431Zm4 0v-76.53h3.29V431Zm4 0v-1.36H517V431Zm3.98 0v-1.18h3.29V431Zm7.95 0v-18.46h3.29V431Zm3.97 0v-3.29h3.28V431Zm3.95 0v-1.1h3.29v1.1Zm3.95 0v-8.01h3.29V431Zm3.95 0v-7.92h3.28V431Zm3.94 0v-.6h3.28v.6Zm3.93 0v-2.6h3.28v2.6Zm7.86 0v-2.03h3.28V431Zm3.92 0v-5.3h3.28v5.3Zm3.92 0v-2.47h3.28V431Zm3.91 0v-7.69h3.29V431Zm7.83 0v-.54h3.29v.54Zm3.91 0v-1.89h3.29V431Zm7.82 0V311.11h3.29V431Z" class="point" style="vector-effect:none;opacity:1;stroke-width:.5px;fill:#636efa;fill-opacity:1;stroke:#fff;stroke-opacity:1"/></g></g><g class="trace bars" style="opacity:1"><g class="points"><path d="M91.83 431v-58.23h3.28V431Zm59.83 0v-.2h3.28v.2Zm26.94 0v-33.73h3.28V431Zm8.18 0V20.52h3.28V431Zm29.93 0V286.06H220V431Zm20.25 0v-43.08h3.28V431Zm30.81 0v-.71h3.28v.71Zm17.15 0v-22.24h3.29V431Zm26.91 0V236.42h3.28V431Zm15.33 0v-20.39h3.28V431Zm24.45 0v-.19h3.29v.19Zm14.12 0v-5.38h3.29V431Zm4.63 0V244.99h3.29V431Zm18.16 0v-44.76h3.28V431Zm13.28 0v-10.8h3.28V431Zm21.59 0v-.01h3.28v.01Zm12.67 0v-10.56h3.28V431Zm20.73 0v-29.26h3.28V431Zm12.23 0v-7.51h3.29V431Zm20.11 0v-.51h3.28v.51Zm11.92 0v-8.09h3.28V431Zm3.95 0v-76.53h3.29V431Zm15.73 0v-63.26h3.28V431Zm11.71 0v-10.06h3.28V431Zm19.4 0v-.08h3.28v.08Zm11.59 0v-4.9h3.28v4.9Zm19.26 0v-60.05h3.29V431Z" class="point" style="vector-effect:none;opacity:1;stroke-width:.5px;fill:#ef553b;fill-opacity:1;stroke:#fff;stroke-opacity:1"/></g></g></g></g><path d="M65 442.5h625M65 10.5h625" class="xlines-above crisp" style="fill:none;stroke-width:1px;stroke:#000;stroke-opacity:1"/><path d="M65.5 11v431m624-431v431" class="ylines-above crisp" style="fill:none;stroke-width:1px;stroke:#000;stroke-opacity:1"/><g class="xaxislayer-above"><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(66)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(131.69)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(197.38)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(263.07)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(328.75)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(394.44)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(460.13)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(525.82)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(591.51)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(657.2)"/><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(66)">0</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(131.69)">10</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(197.38)">20</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(263.07)">30</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(328.75)">40</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(394.44)">50</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(460.13)">60</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(525.82)">70</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(591.51)">80</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(657.2)">90</text></g><g class="yaxislayer-above"><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 442)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 359.9)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 277.81)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 195.71)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 113.62)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 31.52)"/><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 442)">0</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 359.9)">20</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 277.81)">40</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 195.71)">60</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 113.62)">80</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 31.52)">100</text></g></g></g><defs><clipPath id="b"><path d="M0 0h157v48H0z"/></clipPath></defs><g class="infolayer"><g class="legend" pointer-events="all"><path d="M0 0h157v48H0z" class="bg" shape-rendering="crispEdges" style="stroke:#444;stroke-opacity:1;fill:#fff;fill-opacity:1;stroke-width:0" transform="translate(532 11)"/><g class="scrollbox" clip-path="url(#b)" transform="translate(532 11)"><g class="groups"><g class="traces" style="opacity:1"><text x="40" y="4.68" class="legendtext" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" transform="translate(0 14.5)">Zr8 Bi12 O28 (1)</text><g class="layers" style="opacity:1"><g class="legendsymbols"><g class="legendpoints"><path d="M6 6H-6V-6H6Z" class="legendundefined" style="stroke-width:.5px;fill:#636efa;fill-opacity:1;stroke:#fff;stroke-opacity:1" transform="translate(20 14.5)"/></g></g></g><path fill="none" d="M0-9.5h151.266v19H0z" class="legendtoggle" style="fill:#000;fill-opacity:0" transform="translate(0 14.5)"/></g><g class="traces" style="opacity:1"><text x="40" y="4.68" class="legendtext" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" transform="translate(0 33.5)">Zr4 Bi4 O14 (227)</text><g class="layers" style="opacity:1"><g class="legendsymbols"><g class="legendpoints"><path d="M6 6H-6V-6H6Z" class="legendundefined" style="stroke-width:.5px;fill:#ef553b;fill-opacity:1;stroke:#fff;stroke-opacity:1" transform="translate(20 33.5)"/></g></g></g><path fill="none" d="M0-9.5h151.266v19H0z" class="legendtoggle" style="fill:#000;fill-opacity:0" transform="translate(0 33.5)"/></g></g></g></g><g class="g-xtitle"><text x="377.5" y="489.206" class="xtitle" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:14px;fill:#000;opacity:1;white-space:pre" text-anchor="middle">2θ (degrees)</text></g><g class="g-ytitle"><text x="15.303" y="226.5" class="ytitle" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:14px;fill:#000;opacity:1;white-space:pre" text-anchor="middle" transform="rotate(-90 15.303 226.5)">Intensity (a.u.)</text></g><g class="annotation" data-index="0" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h44v49H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(591 252)"/><text x="22.703" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(591 252)"><tspan x="22.703" y="14" class="line" dy="0em">624</tspan><tspan x="22.703" y="14" class="line" dy="1.3em">408</tspan><tspan x="22.703" y="14" class="line" dy="2.6em">89.84°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m636.16 302.11 20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(44.988 -60.21 951.782)"/></g></g><g class="annotation" data-index="1" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h37v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(140 259)"/><text x="18.891" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(140 259)"><tspan x="18.891" y="14" class="line" dy="0em">001</tspan><tspan x="18.891" y="14" class="line" dy="1.3em">8.27°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m140.3 293.11-20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(135 -4.047 181.2)"/></g></g><g class="annotation" data-index="2" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h44v49H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(461 187)"/><text x="22.703" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(461 187)"><tspan x="22.703" y="14" class="line" dy="0em">422</tspan><tspan x="22.703" y="14" class="line" dy="1.3em">206</tspan><tspan x="22.703" y="14" class="line" dy="2.6em">57.12°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m461.19 236.6-20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(135 168.101 219.404)"/></g></g><g class="annotation" data-index="3" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h44v49H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(402 26)"/><text x="22.703" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(402 26)"><tspan x="22.703" y="14" class="line" dy="0em">400</tspan><tspan x="22.703" y="14" class="line" dy="1.3em">224</tspan><tspan x="22.703" y="14" class="line" dy="2.6em">48.12°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m402.09 75.8-20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(135 171.854 126.764)"/></g></g><g class="annotation" data-index="4" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h44v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(276 52)"/><text x="22.703" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(276 52)"><tspan x="22.703" y="14" class="line" dy="0em">202</tspan><tspan x="22.703" y="14" class="line" dy="1.3em">28.91°</tspan></text></g></g></g><g class="annotation" data-index="5" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h44v64H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(508 280)"/><text x="22.703" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(508 280)"><tspan x="22.703" y="14" class="line" dy="0em">644</tspan><tspan x="22.703" y="14" class="line" dy="1.3em">622</tspan><tspan x="22.703" y="14" class="line" dy="2.6em">40-2</tspan><tspan x="22.703" y="14" class="line" dy="3.9em">77.13°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m552.65 345.47 20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(44.988 -154.32 872.626)"/></g></g><g class="annotation" data-index="6" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h44v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(219 243)"/><text x="22.703" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(219 243)"><tspan x="22.703" y="14" class="line" dy="0em">220</tspan><tspan x="22.703" y="14" class="line" dy="1.3em">33.24°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m264.36 277.06 20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(45 -215.753 490.214)"/></g></g><g class="annotation" data-index="7" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h44v64H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(373 171)"/><text x="22.703" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(373 171)"><tspan x="22.703" y="14" class="line" dy="0em">442</tspan><tspan x="22.703" y="14" class="line" dy="1.3em">420</tspan><tspan x="22.703" y="14" class="line" dy="2.6em">22-2</tspan><tspan x="22.703" y="14" class="line" dy="3.9em">56.63°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m418 235.99 20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(45 -89.357 655.139)"/></g></g><g class="annotation" data-index="8" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h44v49H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(314 177)"/><text x="22.703" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(314 177)"><tspan x="22.703" y="14" class="line" dy="0em">422</tspan><tspan x="22.703" y="14" class="line" dy="1.3em">20-2</tspan><tspan x="22.703" y="14" class="line" dy="2.6em">47.72°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m359.47 227.42 20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(45 -108.277 580.202)"/></g></g><g class="annotation" data-index="9" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h44v49H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(189 52)"/><text x="22.703" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(189 52)"><tspan x="22.703" y="14" class="line" dy="0em">222</tspan><tspan x="22.703" y="14" class="line" dy="1.3em">200</tspan><tspan x="22.703" y="14" class="line" dy="2.6em">28.68°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m234.42 51.52 20-20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(-45.001 165.907 -289.777)"/></g></g></g></svg>
\ No newline at end of file
diff --git a/assets/xrd-pattern.svg b/assets/xrd-pattern.svg
index 33c1cddb..73e3cc82 100644
--- a/assets/xrd-pattern.svg
+++ b/assets/xrd-pattern.svg
@@ -1,1 +1,1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="700" height="500" class="main-svg"><path d="M0 0h700v500H0z" style="fill:#fff;fill-opacity:1"/><defs><clipPath id="a" class="plotclip"><path d="M0 0h623v431H0z"/></clipPath></defs><g class="cartesianlayer"><g class="subplot xy"><g class="gridlayer"><g class="x"><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(132.31)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(198.62)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(264.92)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(331.23)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(397.54)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(463.85)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(530.16)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(596.47)"/><path d="M0 11v431" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(662.77)"/></g><g class="y"><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 359.9)"/><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 277.81)"/><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 195.71)"/><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 113.62)"/><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 31.52)"/></g></g><g class="zerolinelayer"><path d="M66 0h623" class="yzl zl crisp" style="stroke:#ebf0f8;stroke-opacity:1;stroke-width:2px" transform="translate(0 442)"/></g><g class="plot" clip-path="url(#a)" transform="translate(66 11)"><g class="barlayer mlayer"><g class="trace bars" style="opacity:1"><g class="points"><path d="M92.69 431v-58.23h3.32V431Zm60.4 0v-.2h3.32v.2Zm27.19 0v-33.73h3.32V431Zm8.26 0V20.52h3.32V431Zm30.22 0V286.06h3.31V431Zm20.43 0v-43.08h3.32V431Zm31.1 0v-.71h3.32v.71Zm17.32 0v-22.24h3.31V431Zm27.16 0V236.42h3.32V431Zm15.47 0v-20.39h3.32V431Zm24.69 0v-.19h3.31v.19Zm14.25 0v-5.38h3.32V431Zm4.67 0V244.99h3.32V431Zm18.33 0v-44.76h3.31V431Zm13.4 0v-10.8h3.32V431Zm21.8 0v-.01h3.31v.01Zm12.79 0v-10.56h3.32V431Zm20.93 0v-29.26h3.31V431Zm12.35 0v-7.51h3.31V431Zm20.29 0v-.51h3.32v.51Zm12.04 0v-8.09h3.31V431Zm3.99 0v-76.53h3.31V431Zm15.87 0v-63.26h3.31V431Zm11.82 0v-10.06h3.31V431Zm19.58 0v-.08h3.32v.08Zm11.7 0v-4.9h3.32v4.9Zm19.45 0v-60.05h3.31V431Z" class="point" style="vector-effect:none;opacity:1;stroke-width:.5px;fill:#636efa;fill-opacity:1;stroke:#fff;stroke-opacity:1"/></g></g></g></g><path d="M65 442.5h625M65 10.5h625" class="xlines-above crisp" style="fill:none;stroke-width:1px;stroke:#000;stroke-opacity:1"/><path d="M65.5 11v431m624-431v431" class="ylines-above crisp" style="fill:none;stroke-width:1px;stroke:#000;stroke-opacity:1"/><g class="xaxislayer-above"><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(66)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(132.31)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(198.62)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(264.92)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(331.23)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(397.54)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(463.85)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(530.16)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(596.47)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(662.77)"/><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(66)">0</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(132.31)">10</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(198.62)">20</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(264.92)">30</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(331.23)">40</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(397.54)">50</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(463.85)">60</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(530.16)">70</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(596.47)">80</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(662.77)">90</text></g><g class="yaxislayer-above"><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 442)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 359.9)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 277.81)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 195.71)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 113.62)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 31.52)"/><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 442)">0</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 359.9)">20</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 277.81)">40</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 195.71)">60</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 113.62)">80</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 31.52)">100</text></g></g></g><g class="infolayer"><g class="g-xtitle"><text x="377.5" y="489.206" class="xtitle" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:14px;fill:#000;opacity:1;white-space:pre" text-anchor="middle">2θ (degrees)</text></g><g class="g-ytitle"><text x="15.303" y="226.5" class="ytitle" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:14px;fill:#000;opacity:1;white-space:pre" text-anchor="middle" transform="rotate(-90 15.303 226.5)">Intensity (a.u.)</text></g><g class="annotation" data-index="0" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h179v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(597 311)"/><text x="89.75" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(597 311)"><tspan x="89.75" y="14" class="line" dy="0em">(6, 4, 4), (6, 2, 2), (4, 0, -2)</tspan><tspan x="89.75" y="14" class="line" dy="1.3em">77.13°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m597.42 345.47-20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(135.012 213.692 302.017)"/></g></g><g class="annotation" data-index="1" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h54v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(306 243)"/><text x="27.484" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(306 243)"><tspan x="27.484" y="14" class="line" dy="0em">(2, 2, 0)</tspan><tspan x="27.484" y="14" class="line" dy="1.3em">33.24°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m306.41 277.06-20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(135 82.332 207.578)"/></g></g><g class="annotation" data-index="2" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h179v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(462 202)"/><text x="89.75" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(462 202)"><tspan x="89.75" y="14" class="line" dy="0em">(4, 4, 2), (4, 2, 0), (2, 2, -2)</tspan><tspan x="89.75" y="14" class="line" dy="1.3em">56.63°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m461.51 235.99-20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(135 168.388 219.165)"/></g></g><g class="annotation" data-index="3" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h119v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(402 193)"/><text x="59.984" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(402 193)"><tspan x="59.984" y="14" class="line" dy="0em">(4, 2, 2), (2, 0, -2)</tspan><tspan x="59.984" y="14" class="line" dy="1.3em">47.72°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m402.43 227.42-20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(135 140.623 202.645)"/></g></g><g class="annotation" data-index="4" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h114v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(221 18)"/><text x="57.25" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(221 18)"><tspan x="57.25" y="14" class="line" dy="0em">(2, 2, 2), (2, 0, 0)</tspan><tspan x="57.25" y="14" class="line" dy="1.3em">28.68°</tspan></text></g></g></g></g></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="700" height="500" class="main-svg"><path d="M0 0h700v500H0z" style="fill:#fff;fill-opacity:1"/><defs><clipPath id="a" class="plotclip"><path d="M0 0h623v402H0z"/></clipPath></defs><g class="cartesianlayer"><g class="subplot xy"><g class="gridlayer"><g class="x"><path d="M0 40v402" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(131.69)"/><path d="M0 40v402" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(197.38)"/><path d="M0 40v402" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(263.07)"/><path d="M0 40v402" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(328.75)"/><path d="M0 40v402" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(394.44)"/><path d="M0 40v402" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(460.13)"/><path d="M0 40v402" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(525.82)"/><path d="M0 40v402" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(591.51)"/><path d="M0 40v402" class="xgrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(657.2)"/></g><g class="y"><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 365.43)"/><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 288.86)"/><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 212.29)"/><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 135.71)"/><path d="M66 0h623" class="ygrid crisp" style="stroke:#d3d3d3;stroke-opacity:1;stroke-width:1px" transform="translate(0 59.14)"/></g></g><g class="zerolinelayer"><path d="M66 0h623" class="yzl zl crisp" style="stroke:#ebf0f8;stroke-opacity:1;stroke-width:2px" transform="translate(0 442)"/></g><g class="plot" clip-path="url(#a)" transform="translate(66 40)"><g class="barlayer mlayer"><g class="trace bars" style="opacity:1"><g class="points"><path d="M52.65 402V281.78h3.29V402Zm22.56 0v-29.51h3.29V402Zm17.36 0v-65.31h3.28V402Zm14.66 0v-53.02h3.29V402Zm12.96 0v-13h3.29v13Zm11.75 0v-17.78h3.28V402Zm20.94 0v-25.51h3.28V402Zm9.52 0v-9.2h3.28v9.2Zm9.03 0v-9.79h3.28V402Zm8.61 0v-69.8h3.28V402Zm8.25 0V19.14h3.28V402Zm7.94 0v-4.16h3.28V402Zm7.65 0v-12.94h3.29V402Zm14.6 0v-40.1h3.28V402Zm6.98 0v-4.35h3.29V402Zm6.8 0v-7.02h3.29V402Zm6.64 0v-21.85h3.28V402Zm6.48 0v-30.49h3.28V402Zm6.33 0v-4.43H255V402Zm6.21 0v-3.58h3.29V402Zm12.06 0v-12.69h3.28V402Zm5.86 0v-11.93h3.29V402Zm5.77 0v-8.51h3.29V402Zm5.68 0v-28.53h3.28V402Zm11.09 0v-4.22h3.28V402Zm5.42 0v-4.62h3.29V402Zm10.64 0V79.1h3.29V402Zm5.22 0v-9.68h3.29V402Zm5.16 0v-3.84h3.28V402Zm5.1 0v-18.34h3.28V402Zm5.04 0v-16.46h3.28V402Zm4.98 0v-.98h3.29v.98Zm4.94 0v-4.87h3.28V402Zm9.73 0v-6.01h3.28V402Zm4.8 0v-8.24h3.28V402Zm4.75 0v-2.79h3.28V402Zm4.71 0v-10.68h3.29V402Zm4.68 0V229.07h3.28V402Zm4.63 0v-2.17h3.29V402Zm4.61 0v-2.42h3.28V402Zm9.1 0v-12.05h3.28V402Zm4.5 0v-2.96h3.29V402Zm4.47 0v-3.73h3.29V402Zm4.45 0v-10.25h3.28V402Zm4.41 0v-7.46h3.29V402Zm4.39 0v-1.68h3.29V402Zm4.37 0v-3.78h3.28V402Zm8.65 0v-7.15h3.29V402Zm4.3 0v-.76h3.28v.76Zm4.27 0v-.85h3.28v.85Zm4.25 0v-19.59h3.28V402Zm8.44 0v-1.35h3.28V402Zm4.19 0v-3.06h3.29V402Zm8.33 0v-50.51h3.29V402Zm4.15 0v-4.07h3.28V402Zm4.12 0v-2.78h3.29V402Zm4.11 0v-3.36h3.29V402Zm4.1 0v-9.89h3.28V402Zm4.08 0v-1.49h3.29V402Zm4.07 0v-1.28h3.29V402Zm8.11 0v-3.68h3.28V402Zm4.03 0v-.53h3.29v.53Zm4.03 0v-2.95h3.28V402Zm4.01 0v-10.67H509V402Zm4 0v-71.38h3.29V402Zm4 0v-1.27H517V402Zm3.98 0v-1.1h3.29v1.1Zm7.95 0v-17.22h3.29V402Zm3.97 0v-3.07h3.28V402Zm3.95 0v-1.03h3.29V402Zm3.95 0v-7.47h3.29V402Zm3.95 0v-7.39h3.28V402Zm3.94 0v-.56h3.28v.56Zm3.93 0v-2.43h3.28V402Zm7.86 0v-1.89h3.28V402Zm3.92 0v-4.94h3.28V402Zm3.92 0v-2.3h3.28v2.3Zm3.91 0v-7.17h3.29V402Zm7.83 0v-.5h3.29v.5Zm3.91 0v-1.76h3.29V402Zm7.82 0V290.17h3.29V402Z" class="point" style="vector-effect:none;opacity:1;stroke-width:.5px;fill:#636efa;fill-opacity:1;stroke:#fff;stroke-opacity:1"/></g></g></g></g><path d="M65 442.5h625M65 39.5h625" class="xlines-above crisp" style="fill:none;stroke-width:1px;stroke:#000;stroke-opacity:1"/><path d="M65.5 40v402m624-402v402" class="ylines-above crisp" style="fill:none;stroke-width:1px;stroke:#000;stroke-opacity:1"/><g class="xaxislayer-above"><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(66)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(131.69)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(197.38)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(263.07)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(328.75)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(394.44)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(460.13)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(525.82)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(591.51)"/><path d="M0 443v5" class="xtick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(657.2)"/><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(66)">0</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(131.69)">10</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(197.38)">20</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(263.07)">30</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(328.75)">40</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(394.44)">50</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(460.13)">60</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(525.82)">70</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(591.51)">80</text><text y="462.4" class="xtick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="middle" transform="translate(657.2)">90</text></g><g class="yaxislayer-above"><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 442)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 365.43)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 288.86)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 212.29)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 135.71)"/><path d="M65 0h-5" class="ytick ticks crisp" style="stroke:#444;stroke-opacity:1;stroke-width:1px" transform="translate(0 59.14)"/><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 442)">0</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 365.43)">20</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 288.86)">40</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 212.29)">60</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 135.71)">80</text><text x="57.6" y="4.2" class="ytick" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre;opacity:1" text-anchor="end" transform="translate(0 59.14)">100</text></g></g></g><g class="infolayer"><g class="g-gtitle"><text x="350" y="15" class="gtitle" dy=".7em" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:17px;fill:#000;opacity:1;white-space:pre" text-anchor="middle">Zr8 Bi12 O28 (1)</text></g><g class="g-xtitle"><text x="377.5" y="489.206" class="xtitle" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:14px;fill:#000;opacity:1;white-space:pre" text-anchor="middle">2θ (degrees)</text></g><g class="g-ytitle"><text x="15.303" y="241" class="ytitle" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:14px;fill:#000;opacity:1;white-space:pre" text-anchor="middle" transform="rotate(-90 15.303 241)">Intensity (a.u.)</text></g><g class="annotation" data-index="0" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h44v49H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(591 260)"/><text x="22.703" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(591 260)"><tspan x="22.703" y="14" class="line" dy="0em">624</tspan><tspan x="22.703" y="14" class="line" dy="1.3em">408</tspan><tspan x="22.703" y="14" class="line" dy="2.6em">89.84°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m636.16 310.17 20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(44.988 -69.942 955.812)"/></g></g><g class="annotation" data-index="1" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h37v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(140 268)"/><text x="18.891" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(140 268)"><tspan x="18.891" y="14" class="line" dy="0em">001</tspan><tspan x="18.891" y="14" class="line" dy="1.3em">8.27°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m140.3 301.78-20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(135 -5.843 185.536)"/></g></g><g class="annotation" data-index="2" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h44v49H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(461 199)"/><text x="22.703" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(461 199)"><tspan x="22.703" y="14" class="line" dy="0em">422</tspan><tspan x="22.703" y="14" class="line" dy="1.3em">206</tspan><tspan x="22.703" y="14" class="line" dy="2.6em">57.12°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m461.19 249.07-20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(135 165.519 225.64)"/></g></g><g class="annotation" data-index="3" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h44v49H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(402 49)"/><text x="22.703" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(402 49)"><tspan x="22.703" y="14" class="line" dy="0em">400</tspan><tspan x="22.703" y="14" class="line" dy="1.3em">224</tspan><tspan x="22.703" y="14" class="line" dy="2.6em">48.12°</tspan></text></g></g><g class="annotation-arrow-g" style="opacity:1"><path d="m402.09 99.1-20 20" style="stroke-width:1px;stroke:#2a3f5f;stroke-opacity:1;stroke-dasharray:0,0,26.9843px,28.2843px"/><path d="M-3.7-2.5v5l5-2.5Z" style="fill:#2a3f5f;stroke-width:0" transform="rotate(135 167.029 138.414)"/></g></g><g class="annotation" data-index="4" style="opacity:1"><g class="annotation-text-g"><g class="cursor-pointer"><path fill="none" d="M.5.5h44v33H.5z" class="bg" style="stroke-width:1px;stroke:#000;stroke-opacity:0;fill:#000;fill-opacity:0" transform="translate(276 79)"/><text x="22.703" y="14" class="annotation-text" style="font-family:&quot;Open Sans&quot;,verdana,arial,sans-serif;font-size:12px;fill:#000;fill-opacity:1;white-space:pre" text-anchor="middle" transform="translate(276 79)"><tspan x="22.703" y="14" class="line" dy="0em">202</tspan><tspan x="22.703" y="14" class="line" dy="1.3em">28.91°</tspan></text></g></g></g></g></svg>
\ No newline at end of file
diff --git a/pymatviz/xrd.py b/pymatviz/xrd.py
index c3a7993d..ec293d89 100644
--- a/pymatviz/xrd.py
+++ b/pymatviz/xrd.py
@@ -2,41 +2,72 @@
 
 from __future__ import annotations
 
-from typing import Any
+from typing import Any, Literal, get_args
 
 import numpy as np
 import plotly.graph_objects as go
-from pymatgen.analysis.diffraction.xrd import DiffractionPattern
+from pymatgen.analysis.diffraction.xrd import DiffractionPattern, XRDCalculator
+from pymatgen.core import Structure
+
+
+HklFormat = Literal["compact", "full", None]
+ValidHklFormats = HklCompact, HklFull, HklNone = get_args(HklFormat)
+
+
+def format_hkl(hkl: tuple[int, int, int], format_type: HklFormat) -> str:
+    """Format hkl indices as a string."""
+    if format_type == "compact":
+        return "".join(map(str, hkl))
+    if format_type == "full":
+        return f"({', '.join(map(str, hkl))})"
+    if format_type is None:
+        return ""
+    raise ValueError(f"{format_type=} must be one of {ValidHklFormats}")
 
 
 def plot_xrd_pattern(
     patterns: DiffractionPattern
-    | dict[str, DiffractionPattern | tuple[DiffractionPattern, dict[str, Any]]],
+    | Structure
+    | dict[
+        str,
+        DiffractionPattern
+        | Structure
+        | tuple[DiffractionPattern | Structure, dict[str, Any]],
+    ],
+    *,
     peak_width: float = 0.5,
     annotate_peaks: float = 5,
+    hkl_format: HklFormat = HklCompact,
+    show_angles: bool | None = None,
+    wavelength: float = 1.54184,  # Cu K-alpha wavelength
 ) -> go.Figure:
-    """Create a plotly figure of XRD patterns from a DiffractionPattern object or a
-    dictionary of DiffractionPattern objects.
+    """Create a plotly figure of XRD patterns from DiffractionPattern, Structure
+    objects, or a dictionary of them.
 
     Args:
-        patterns (DiffractionPattern | dict[str, DiffractionPattern | tuple[DiffractionPattern, dict]]):
-            Either a single DiffractionPattern object
-            or a dictionary where keys are legend labels and values are either
-            DiffractionPattern objects or tuples of (DiffractionPattern, kwargs) for
-            customizing individual patterns.
-        peak_width (float): Width of the diffraction peaks in degrees. Default is 0.5.
-        annotate_peaks (int | float): Controls peak annotation. If int, annotates that
-            many highest peaks. If float, should be in (0, 1) which will annotate peaks
-            higher than that fraction of the highest peak. Default is 5.
+        patterns: Either a single DiffractionPattern or Structure object, or a
+            dictionary where keys are legend labels
+            and values are either DiffractionPattern/Structure objects or tuples of
+            (DiffractionPattern/Structure, kwargs) for customizing individual patterns.
+        peak_width: Width of the diffraction peaks in degrees. Default is 0.5.
+        annotate_peaks: Controls peak annotation. If int, annotates that many highest
+            peaks. If float, should be in (0, 1) which will annotate peaks higher than
+            that fraction of the highest peak. Default is 5.
+        hkl_format: Format for hkl indices. One of 'compact' ('100'), 'full'
+            ('(1, 0, 0)'), or None for no hkl indices. Default is 'compact' for 3 or
+            fewer patterns, None for 4 or more patterns.
+        show_angles: Whether to show angles in peak annotations. If None, it will
+            default to True if plotting 1 or 2 patterns, False for 3 or more patterns.
+        wavelength: X-ray wavelength for the XRD calculation (in Angstroms). Default is
+            1.54184 (Cu K-alpha). Only used if patterns contains Structure objects.
 
     Raises:
         ValueError: If annotate_peaks is not a positive int or a float in (0, 1).
-        TypeError: If patterns is not a DiffractionPattern or a dictionary of
-        DiffractionPatterns or tuples of (DiffractionPattern, kwargs).
+        TypeError: If patterns is not a DiffractionPattern, Structure or a dict of them.
 
     Returns:
         go.Figure: A plotly figure of the XRD pattern(s).
-    """  # noqa: E501
+    """
     if (
         not isinstance(annotate_peaks, (int, float))
         or annotate_peaks <= 0
@@ -55,25 +86,37 @@ def plot_xrd_pattern(
     fig = go.Figure(layout=layout)
     max_intensity = max_two_theta = 0
 
-    # Convert single DiffractionPattern to dict for uniform processing
-    if isinstance(patterns, DiffractionPattern):
+    # Convert single object to dict for uniform processing
+    if isinstance(patterns, (DiffractionPattern, Structure)):
         patterns = {"XRD Pattern": patterns}
     elif not isinstance(patterns, dict):
         raise TypeError(
-            f"{patterns=} should be a DiffractionPattern object or a dictionary of them"
+            f"{patterns=} should be a DiffractionPattern, Structure or a dict of them"
         )
 
+    # Determine show_angles based on number of patterns
+    if show_angles is None:
+        show_angles = len(patterns) <= 2
+
+    plotted_patterns: list[DiffractionPattern] = []
     for label, pattern_data in patterns.items():
         if isinstance(pattern_data, tuple):
-            diffraction_pattern, trace_kwargs = pattern_data
+            pattern_or_struct, trace_kwargs = pattern_data
         else:
-            diffraction_pattern, trace_kwargs = pattern_data, {}
+            pattern_or_struct, trace_kwargs = pattern_data, {}
 
-        if not isinstance(diffraction_pattern, DiffractionPattern):
+        if isinstance(pattern_or_struct, Structure):
+            xrd_calculator = XRDCalculator(wavelength=wavelength)
+            diffraction_pattern = xrd_calculator.get_pattern(pattern_or_struct)
+        elif isinstance(pattern_or_struct, DiffractionPattern):
+            diffraction_pattern = pattern_or_struct
+        else:
+            value = pattern_or_struct
             raise TypeError(
-                f"{diffraction_pattern=} should be a pymatgen DiffractionPattern object"
+                f"{value=} should be a pymatgen Structure or DiffractionPattern"
             )
 
+        plotted_patterns += [diffraction_pattern]
         two_theta = diffraction_pattern.x
         intensities = diffraction_pattern.y
         hkls = diffraction_pattern.hkls
@@ -84,27 +127,28 @@ def plot_xrd_pattern(
                 f"No intensities found in the diffraction pattern for {label}"
             )
 
-        # Update max intensity and two_theta
+        # Update max intensity and two_theta across all patterns
         max_intensity = max(max_intensity, *intensities)
         max_two_theta = max(max_two_theta, *two_theta)
 
-        # Create the trace for this pattern
-        trace = go.Bar(
+        tooltips = [
+            f"<b>{label}</b><br>"
+            f"2θ: {x:.2f}°<br>Intensity: {y:.2f}<br>hkl: "
+            f"{'<br>'.join(format_hkl(h['hkl'], HklFull) for h in hkl)}<br>d: {d:.3f} Å"
+            for x, y, hkl, d in zip(two_theta, intensities, hkls, d_hkls)
+        ]
+        fig.add_bar(
             x=two_theta,
             y=intensities,
             width=peak_width,
             name=label,
-            hovertext=[
-                f"2θ: {x:.2f}°<br>Intensity: {y:.2f}<br>hkl: "
-                f"{', '.join(str(h['hkl']) for h in hkl)}<br>d: {d:.3f} Å"
-                for x, y, hkl, d in zip(two_theta, intensities, hkls, d_hkls)
-            ],
+            hovertext=tooltips,
+            hoverinfo="text",
             **trace_kwargs,
         )
-        fig.add_trace(trace)
 
     # Normalize intensities to 100 and add annotations
-    for trace in fig.data:
+    for trace_idx, trace in enumerate(fig.data):
         trace.y = [y / max_intensity * 100 for y in trace.y]
 
         if isinstance(annotate_peaks, int) and annotate_peaks > 0:
@@ -121,20 +165,30 @@ def plot_xrd_pattern(
             )
 
         for idx in peak_indices:
-            hkl_str = trace.hovertext[idx].split("hkl: ")[1].split("<br>")[0]
             x_pos = trace.x[idx]
             y_pos = trace.y[idx]
 
-            annotation_text = f"{hkl_str}<br>{x_pos:.2f}°"
-
-            ax, ay = 20, -20
-            xanchor, yanchor = "left", "bottom"
+            if hkl_format:
+                hkl_formatted = "<br>".join(
+                    format_hkl(h["hkl"], hkl_format)
+                    for h in plotted_patterns[trace_idx].hkls[idx]
+                )
+                annotation_text = f"{hkl_formatted}"
+                if show_angles:
+                    annotation_text += f"<br>{x_pos:.2f}°"
+            elif show_angles:
+                annotation_text = f"{x_pos:.2f}°"
+            else:
+                continue  # Skip annotation if neither hkl nor angle is shown
+
+            # Determine annotation direction
+            ax, ay = (20, -20) if trace_idx % 2 == 0 else (-20, -20)
+
+            # Adjust position for edges of the plot
             if x_pos > max_two_theta * 0.9:
-                ax, ay = -20, -20
-                xanchor, yanchor = "right", "bottom"
+                ax = -abs(ax)
             elif y_pos > 90:
-                ax, ay = 80, 20
-                xanchor, yanchor = "right", "bottom"
+                ay = abs(ay)
 
             fig.add_annotation(
                 x=x_pos,
@@ -145,8 +199,8 @@ def plot_xrd_pattern(
                 arrowwidth=1,
                 ax=ax,
                 ay=ay,
-                xanchor=xanchor,
-                yanchor=yanchor,
+                xanchor="left" if ax > 0 else "right",
+                yanchor="bottom" if ay < 0 else "top",
             )
 
     fig.layout.xaxis.range = [0, max_two_theta + 5]


Test patch:
diff --git a/tests/test_xrd.py b/tests/test_xrd.py
index 17ac033d..1e73d35f 100644
--- a/tests/test_xrd.py
+++ b/tests/test_xrd.py
@@ -1,4 +1,7 @@
+from __future__ import annotations
+
 import re
+from typing import Any
 
 import plotly.graph_objects as go
 import pytest
@@ -7,6 +10,7 @@
 
 from pymatviz import plot_xrd_pattern
 from pymatviz.utils import TEST_FILES
+from pymatviz.xrd import HklCompact, HklFormat, HklFull, HklNone
 
 
 mock_diffraction_pattern = DiffractionPattern(
@@ -28,12 +32,20 @@
 bi2_zr2_o7_xrd = XRDCalculator().get_pattern(bi2_zr2_o7_struct)
 
 
-@pytest.mark.parametrize("diffract_patt", [mock_diffraction_pattern, bi2_zr2_o7_xrd])
-def test_plot_xrd_pattern_basic(diffract_patt: DiffractionPattern) -> None:
-    fig = plot_xrd_pattern(diffract_patt)
+@pytest.mark.parametrize(
+    "input_data, expected_traces",
+    [
+        (mock_diffraction_pattern, 1),
+        (bi2_zr2_o7_xrd, 1),
+        (bi2_zr2_o7_struct, 1),
+        ({"Structure": bi2_zr2_o7_struct, "Pattern": mock_diffraction_pattern}, 2),
+    ],
+)
+def test_plot_xrd_pattern_input_types(input_data: Any, expected_traces: int) -> None:
+    fig = plot_xrd_pattern(input_data)
     assert isinstance(fig, go.Figure)
-    assert len(fig.data) == 1
-    assert isinstance(fig.data[0], go.Bar)
+    assert len(fig.data) == expected_traces
+    assert all(isinstance(trace, go.Bar) for trace in fig.data)
 
 
 @pytest.mark.parametrize("peak_width", [0.3, 0.5, 0.8])
@@ -52,67 +64,55 @@ def test_plot_xrd_pattern_annotate_peaks(annotate_peaks: float) -> None:
         assert len(annotations) > 0  # At least some peaks should be annotated
 
 
-@pytest.mark.parametrize("diffract_patt", [mock_diffraction_pattern, bi2_zr2_o7_xrd])
-def test_plot_xrd_pattern_hover_data(diffract_patt: DiffractionPattern) -> None:
-    fig = plot_xrd_pattern(diffract_patt)
-    assert len(fig.data[0].hovertext) == len(diffract_patt.x)
+def test_plot_xrd_pattern_hover_data() -> None:
+    fig = plot_xrd_pattern(mock_diffraction_pattern)
+    assert len(fig.data[0].hovertext) == len(mock_diffraction_pattern.x)
     assert all(
-        "2θ" in text and "Intensity" in text and "hkl" in text and "d" in text
+        all(key in text for key in ["2θ", "Intensity", "hkl", "d"])
         for text in fig.data[0].hovertext
     )
 
 
-def test_plot_xrd_pattern_layout() -> None:
+def test_plot_xrd_pattern_layout_and_range() -> None:
     fig = plot_xrd_pattern(mock_diffraction_pattern)
     assert fig.layout.xaxis.title.text == "2θ (degrees)"
     assert fig.layout.yaxis.title.text == "Intensity (a.u.)"
     assert fig.layout.hovermode == "x"
-
-
-def test_plot_xrd_pattern_x_range() -> None:
-    fig = plot_xrd_pattern(mock_diffraction_pattern)
     assert fig.layout.xaxis.range[0] == 0
     assert fig.layout.xaxis.range[1] == max(mock_diffraction_pattern.x) + 5
-
-
-def test_plot_xrd_pattern_y_range() -> None:
-    fig = plot_xrd_pattern(mock_diffraction_pattern)
-    assert fig.layout.yaxis.range[0] == 0
-    assert fig.layout.yaxis.range[1] == 105  # Slightly above 100 to show full peaks
+    assert fig.layout.yaxis.range == (0, 105)
 
 
 @pytest.mark.parametrize(
-    "x_pos, expected_direction",
+    "hkl_format, expected_format, show_angles",
     [
-        (1, (-20, -20)),  # Left 10% of the plot
-        (95, (-20, -20)),  # Right 10% of the plot
-        (50, (-20, -20)),  # Middle, but high intensity
+        (HklCompact, r"\d{3}", True),
+        (HklFull, r"\(\d, \d, \d\)", True),
+        (HklNone, r"\d+\.\d+°", True),
+        (HklCompact, r"\d{3}", False),
+        (HklNone, None, False),
     ],
 )
-def test_plot_xrd_pattern_annotation_directions(
-    x_pos: float, expected_direction: tuple[int, int]
+def test_plot_xrd_pattern_annotation_format(
+    hkl_format: HklFormat, expected_format: str | None, show_angles: bool
 ) -> None:
-    # Modify mock data to test different scenarios
-    mock_diffraction_pattern.x = [x_pos]
-    mock_diffraction_pattern.y = [95]  # High intensity
-    mock_diffraction_pattern.hkls = [[{"hkl": (1, 1, 1)}]]
-    mock_diffraction_pattern.d_hkls = [2.0]
-
-    fig = plot_xrd_pattern(mock_diffraction_pattern)
-    annotation = fig.layout.annotations[0]
-    assert (annotation.ax, annotation.ay) == expected_direction
-
-
-def test_plot_xrd_pattern_annotation_text() -> None:
-    fig = plot_xrd_pattern(mock_diffraction_pattern)
-    for annotation in fig.layout.annotations:
-        assert any(
-            f"({h}, {k}, {l})" in annotation.text
-            for h, k, l in [(1, 0, 0), (1, 1, 0), (1, 1, 1), (2, 0, 0), (2, 1, 0)]  # noqa: E741
-        )
-        assert re.match(
-            r".*<br>\d+\.\d+°", annotation.text
-        ), f"{annotation.text=}"  # Check for degree information on new line
+    fig = plot_xrd_pattern(
+        mock_diffraction_pattern, hkl_format=hkl_format, show_angles=show_angles
+    )
+    if hkl_format is HklNone and not show_angles:
+        assert len(fig.layout.annotations) == 0
+    else:
+        for annotation in fig.layout.annotations:
+            if expected_format:
+                assert re.search(
+                    expected_format, annotation.text
+                ), f"{annotation.text=}"
+            if show_angles:
+                assert re.search(r"\d+\.\d+°", annotation.text), f"{annotation.text=}"
+            else:
+                assert not re.search(
+                    r"\d+\.\d+°", annotation.text
+                ), f"{annotation.text=}"
 
 
 def test_plot_xrd_pattern_empty_input() -> None:
@@ -123,20 +123,55 @@ def test_plot_xrd_pattern_empty_input() -> None:
         plot_xrd_pattern(empty_pattern)
 
 
-def test_plot_xrd_pattern_single_peak() -> None:
-    mock_diffraction_pattern.x = [30]
-    mock_diffraction_pattern.y = [100]
-    mock_diffraction_pattern.hkls = [[{"hkl": (1, 1, 1)}]]
-    mock_diffraction_pattern.d_hkls = [2.0]
-
-    fig = plot_xrd_pattern(mock_diffraction_pattern)
-    assert len(fig.data[0].x) == 1
-    assert len(fig.layout.annotations) == 1
-
-
 def test_plot_xrd_pattern_intensity_normalization() -> None:
     original_max = max(mock_diffraction_pattern.y)
     fig = plot_xrd_pattern(mock_diffraction_pattern)
     normalized_max = max(fig.data[0].y)
     assert normalized_max == 100
     assert normalized_max / original_max == pytest.approx(100 / original_max)
+
+
+@pytest.mark.parametrize("wavelength", [1.54184, 0.7093])
+def test_plot_xrd_pattern_wavelength(wavelength: float) -> None:
+    fig = plot_xrd_pattern(bi2_zr2_o7_struct, wavelength=wavelength)
+    first_peak_position = fig.data[0].x[0]
+    reference_fig = plot_xrd_pattern(bi2_zr2_o7_struct, wavelength=1.54184)
+    reference_first_peak = reference_fig.data[0].x[0]
+    if wavelength != 1.54184:
+        assert first_peak_position != reference_first_peak
+    else:
+        assert first_peak_position == reference_first_peak
+
+
+def test_plot_xrd_pattern_tooltip_content() -> None:
+    patterns = {
+        "Pattern 1": mock_diffraction_pattern,
+        "Pattern 2": mock_diffraction_pattern,
+    }
+    fig = plot_xrd_pattern(patterns, show_angles=False, hkl_format=None)
+
+    for trace in fig.data:
+        assert len(trace.hovertext) > 0
+        for hover_text in trace.hovertext:
+            assert all(key in hover_text for key in ["2θ", "Intensity", "hkl", "d"])
+            assert "°" in hover_text  # Angles should always be in tooltips
+
+
+def test_plot_xrd_pattern_tooltip_label() -> None:
+    patterns = {
+        "Pattern 1": mock_diffraction_pattern,
+        "Pattern 2": mock_diffraction_pattern,
+    }
+    fig = plot_xrd_pattern(patterns)
+
+    assert len(fig.data) == 2
+
+    for trace in fig.data:
+        assert all(
+            hover_text.startswith(f"<b>{trace.name}</b>")
+            for hover_text in trace.hovertext
+        )
+        assert all(
+            all(key in hover_text for key in ["2θ", "Intensity", "hkl", "d"])
+            for hover_text in trace.hovertext
+        )