# Examples from pyvista.plot_compare
# ==================================

# Compare three filtered versions of a dataset.
import pyvista as pv
from pyvista import examples
mesh = examples.load_airplane()
pv.plot_compare(
    [mesh.clip('x'), mesh.clip('y'), mesh.clip('z')],
    color='w',
)

# Use a dictionary to label each dataset and set the camera position explicitly.
pv.plot_compare(
    {
        'clip x': mesh.clip('x'),
        'clip y': mesh.clip('y'),
        'clip z': mesh.clip('z'),
    },
    color='w',
    cpos='xy',
)

# A `MultiBlock` is compared block-by-block, and its block
# names are used as labels.
blocks = pv.MultiBlock(
    {'sphere': pv.Sphere(), 'cube': pv.Cube(), 'cone': pv.Cone()}
)
pv.plot_compare(blocks)

# Control the shape of the plot explicitly.
pv.plot_compare(blocks, shape=(3, 1))

# A shape with more subplots than datasets shows blank plots.
pv.plot_compare(blocks, shape=(2, 2))

# Use a string descriptor to plot one on top, two on the bottom.
pv.plot_compare(blocks, shape='2/1')

# Datasets of very different sizes are compared shape by shape by normalizing
# them. The airplane is some forty times the size of the ant, which is a speck
# beside it otherwise.
pv.plot_compare(
    {
        'airplane': examples.load_airplane(),
        'ant': examples.load_ant(),
    },
    normalize=True,
)

# Add a border around the whole comparison, on top of the lines already
# separating the subplots by default.
pv.plot_compare(blocks, border=True, border_color='grey')

# Plot on a dark background by giving the plotter a theme of its own, which
# also decides the color the labels are drawn in.
pv.plot_compare(blocks, theme='dark')

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code
