-
- # Get the render window
- renWin = win.GetRenderWindow()
-
- # Next, do the VTK stuff
- ren = vtk.vtkRenderer()
- renWin.AddRenderer(ren)
- cone = vtk.vtkConeSource()
- cone.SetResolution(80)
- coneMapper = vtk.vtkPolyDataMapper()
- coneMapper.SetInput(cone.GetOutput())
- coneActor = vtk.vtkActor()
- coneActor.SetMapper(coneMapper)
- ren.AddActor(coneActor)
- coneMapper.GetLookupTable().Build()
-
- # Create a scalar bar
- scalarBar = vtk.vtkScalarBarActor()
- scalarBar.SetLookupTable(coneMapper.GetLookupTable())
- scalarBar.SetTitle("Temperature")
- scalarBar.GetPositionCoordinate().SetCoordinateSystemToNormalizedViewport()
- scalarBar.GetPositionCoordinate().SetValue(0.1, 0.01)
- scalarBar.SetOrientationToHorizontal()
- scalarBar.SetWidth(0.8)
- scalarBar.SetHeight(0.17)
- ren.AddActor2D(scalarBar)