Extract Array to Table

This example will demonstrate how to extract an array from any input data set to make a pyvista.Table of that single data array. Aftwards, we plot a histogram of that data array.

This example demos PVGeo.filters.ExtractArray

from PVGeo.filters import ExtractArray
from pyvista import examples
import matplotlib.pyplot as plt

Create input data

dataset = examples.download_st_helens()

Construct the filter

filt = ExtractArray()
# Define the array to extract
# Apply the filter on the input
table = filt.apply(dataset, 'Elevation')
print(table)

Out:

Table (0x7fb546c4d468)
  N Rows:       152709
  N Arrays:     1
plt.hist(table['Elevation'])
../../_images/sphx_glr_extract-array_001.png

Total running time of the script: ( 0 minutes 1.091 seconds)

Gallery generated by Sphinx-Gallery