I want to use the vtkLegendScaleActor
in my project, but I can not find a way to set the font size.
I have tested:
legendScaleActor.GetLegendLabelProperty().SetFontSize(20)
legendScaleActor.GetLeftAxis().GetLabelTextProperty().SetFontSize(20)
And they don’t help.
I hope to set the font size in the following region:
The complete code is:
import vtk
renderWindow = vtk.vtkRenderWindow()
renderer = vtk.vtkRenderer()
renderWindow.AddRenderer(renderer)
cubeSource = vtk.vtkCubeSource()
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(cubeSource.GetOutputPort())
actor = vtk.vtkActor()
actor.SetMapper(mapper)
renderer.AddActor(actor)
legendScaleActor = vtk.vtkLegendScaleActor()
legendScaleActor.GetLegendLabelProperty().SetFontSize(20)
legendScaleActor.GetLeftAxis().GetLabelTextProperty().SetFontSize(20)
renderer.AddActor(legendScaleActor)
renderWindowInteractor = vtk.vtkRenderWindowInteractor()
renderWindowInteractor.SetRenderWindow(renderWindow)
renderWindow.Render()
renderWindowInteractor.Start()
My vtk version is 9.2.6
.
Any help is appreciated~~~