pyvista.Plotter.set_color_cycler#
- Plotter.set_color_cycler(color_cycler, all_renderers: bool = True)[ソース]#
カラーサイクラーを設定またはリセットします.
This color cycler is iterated over by each sequential
add_meshcall to set the default color of the dataset being plotted.設定するとき,値は色のようなオブジェクトのリスト,または色のようなオブジェクトのサイクラーのいずれかでなければなりません.渡された値が単一の文字列である場合,それは以下のうちの1つでなければなりません.
'default'- デフォルトのカラーサイクラーを使用します (matplotlib のデフォルトと一致します)'matplotlib- Matplotlib の現在のテーマのカラーサイクラーを動的に返します.'all'- Cycle through all available colors inpyvista.plotting.colors.hexcolors
Noneに設定すると,このレンダラーでのカラーサイクラーの使用を無効にします.注釈
If a mesh has scalar data, set
color=Truein the call toadd_mesh()to color the mesh with the next color in the cycler. Otherwise the mesh's scalars are used to color the mesh by default.- パラメータ:
参考
例
デフォルトのカラーサイクラーで,赤,緑,青を反復するように設定します.
>>> import pyvista as pv >>> pl = pv.Plotter() >>> pl.set_color_cycler(['red', 'green', 'blue']) >>> _ = pl.add_mesh(pv.Cone(center=(0, 0, 0))) # red >>> _ = pl.add_mesh(pv.Cube(center=(1, 0, 0))) # green >>> _ = pl.add_mesh(pv.Sphere(center=(1, 1, 0))) # blue >>> _ = pl.add_mesh(pv.Cylinder(center=(0, 1, 0))) # red again >>> pl.show()