注釈
Go to the end to download the full example code.
プロットベクトルコンポーネント#
ベクトルの単一コンポーネントをスカラー配列としてプロットします.
add_mesh
メソッドの component
引数を用いて多成分アレイの個々の成分をプロットすることができる.
from __future__ import annotations
import pyvista as pv
from pyvista import examples
ノッチ付きはり応力の例をダウンロードします
mesh = examples.download_notch_displacement()
コンポーネントが指定されていない場合の既定の動作では,ベクトルの大きさが使用されます.各コンポーネントにアクセスするには,component引数を指定します.
dargs = dict(
scalars='Nodal Displacement',
cmap='jet',
show_scalar_bar=False,
)
pl = pv.Plotter(shape=(2, 2))
pl.subplot(0, 0)
pl.add_mesh(mesh, **dargs)
pl.add_text('Normalized Displacement', color='k')
pl.subplot(0, 1)
pl.add_mesh(mesh.copy(), component=0, **dargs)
pl.add_text('X Displacement', color='k')
pl.subplot(1, 0)
pl.add_mesh(mesh.copy(), component=1, **dargs)
pl.add_text('Y Displacement', color='k')
pl.subplot(1, 1)
pl.add_mesh(mesh.copy(), component=2, **dargs)
pl.add_text('Z Displacement', color='k')
pl.link_views()
pl.camera_position = 'iso'
pl.background_color = 'white'
pl.show()

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