mayavi.mlab.show()的参数是什么
时间: 2023-04-10 07:01:38 浏览: 228
我可以回答这个问题。mayavi.mlab.show()的参数是一个可选的布尔值,用于指定是否使用 GUI 窗口显示绘图结果。如果参数为 False,则绘图结果将在后台生成,而不会显示在 GUI 窗口中。
相关问题
mayavi.mlab.show()的参数有哪些
mayavi.mlab.show()的参数包括:figure、bgcolor、fgcolor、size、reset_zoom、reset_roll、reset_wl、reset_view、stop、exit、verbose、app、title、icon、menu、name、bgcolor、fgcolor、size、position、orientation、resolution、stereo、stereo_capable、stereo_type、stereo_eye_shift、stereo_red_blue、stereo_red_green、stereo_red_cyan、stereo_red_yellow、stereo_red_magenta、stereo_red_custom、stereo_blue_red、stereo_green_red、stereo_cyan_red、stereo_yellow_red、stereo_magenta_red、stereo_custom_red、stereo_anaglyph、stereo_interlaced、stereo_checkerboard、stereo_row_interlaced、stereo_column_interlaced、stereo_side_by_side、stereo_top_bottom、stereo_red_green_half_color、stereo_red_cyan_half_color、stereo_red_blue_half_color、stereo_red_yellow_half_color、stereo_red_magenta_half_color、stereo_custom_half_color、stereo_red_green_full_color、stereo_red_cyan_full_color、stereo_red_blue_full_color、stereo_red_yellow_full_color、stereo_red_magenta_full_color、stereo_custom_full_color、stereo_red_green_dubois、stereo_red_cyan_dubois、stereo_red_blue_dubois、stereo_red_yellow_dubois、stereo_red_magenta_dubois、stereo_custom_dubois、stereo_red_green_anaglyph、stereo_red_cyan_anaglyph、stereo_red_blue_anaglyph、stereo_red_yellow_anaglyph、stereo_red_magenta_anaglyph、stereo_custom_anaglyph、stereo_red_green_interlace、stereo_red_cyan_interlace、stereo_red_blue_interlace、stereo_red_yellow_interlace、stereo_red_magenta_interlace、stereo_custom_interlace、stereo_red_green_checkerboard、stereo_red_cyan_checkerboard、stereo_red_blue_checkerboard、stereo_red_yellow_checkerboard、stereo_red_magenta_checkerboard、stereo_custom_checkerboard、stereo_red_green_row_interlace、stereo_red_cyan_row_interlace、stereo_red_blue_row_interlace、stereo_red_yellow_row_interlace、stereo_red_magenta_row_interlace、stereo_custom_row_interlace、stereo_red_green_column_interlace、stereo_red_cyan_column_interlace、stereo_red_blue_column_interlace、stereo_red_yellow_column_interlace、stereo_red_magenta_column_interlace、stereo_custom_column_interlace。
import pandas as pd from mayavi import mlab import numpy as np order = 7 def funcx(i): raw_data_para = pd.read_csv('D:\Tdata_outdoor20230316点云/第' + str(i + order) + '帧点云.csv') return np.asarray(raw_data_para['x']) def funcy(i): raw_data_para = pd.read_csv('D:\data_outdoor20230316点云/第' + str(i + order) + '帧点云.csv') return np.asarray(raw_data_para['y']) def funcz(i): raw_data_para = pd.read_csv('D:\data_outdoor20230316点云/第' + str(i + order) + '帧点云.csv') return np.asarray(raw_data_para['z']) fig = mlab.figure(bgcolor=(0, 0, 0), size=(640, 500)) raw_data = pd.read_csv('D:\data_outdoor20230316点云/第7帧点云.csv') x = np.asarray(raw_data['x']) y = np.asarray(raw_data['y']) z = np.asarray(raw_data['z']) a = mlab.points3d(y, x, z, # col, # Values used for Color color=(1, 1, 0), mode='point', scale_factor=10000, colormap='hsv', # https://blog.csdn.net/guduruyu/article/details/60868501 figure=fig, ) @mlab.animate(delay=500, ui=True) def anim(): i = 1 while True: print(i) a.mlab_source.reset(x=funcx(i), y=funcy(i), z=funcz(i)) i += 1 yield anim() mlab.show()这段代码为什么会崩溃
这段代码是用Python编写的,主要是用于读取CSV格式的点云数据,并使用Mayavi库进行可视化。其中,pandas库用于读取CSV文件,numpy库用于处理数据,mayavi库用于绘制3D图形。具体实现的功能是定义了三个函数funcx、funcy、funcz,分别用于读取CSV文件中的x、y、z坐标数据,并将其转换为numpy数组。然后,使用Mayavi库的points3d函数将这些点云数据绘制成3D图形。最后,设置了图形的背景色和大小。
阅读全文