Pyvista Colormap

use a Matplotlib, Colorcet, cmocean, or custom colormap when plotting scalar values.    

Choosing Colormaps in Matplotlib — Matplotlib 3.9.2 documentation

User Guide — colorcet v3.1.0 (holoviz.org)

Beautiful colormaps for oceanography: cmocean — cmocean 0.02 documentation (matplotlib.org)

One of the pyvista creator is a geologist, which explains the last option, all the keywords can be used to pass to cmap. The topic that which one will give a better appearance falls on the realm of art.

import pyvista as pv
import numpy as np

points = np.random.random((1000, 3))
pointCloud = pv.PolyData(points)
# scalar is the the z value
pointCloud .plot(scalars=points[:, 2], point_size=5.0, cmap='jet')

Jet colormap

default colormap

Personally, I use default most of time, jet seems to have a better contrast.

clim = [min, max] is another parameter I tweak to improve data visualization.

import pyvista as pv
from pyvista import examples

mesh = examples.load_random_hills()
p = pv.Plotter()
p.add_mesh(mesh,scalars="Elevation",cmap="terrain",clim=[0,10])
p.show()

use help(p.add_mesh) for quick cmap reference and other available display options.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值