I figured out a way by using the vtkAxesActor class directly.

An example script:

from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()

renderView1 = GetActiveViewOrCreate('RenderView')

sphere1 = Sphere()
sphere1.Radius = 1.0
sphere1Display = Show(sphere1, renderView1)
sphere1Display.SetRepresentationType('Outline')

import vtk
renderer = renderView1.GetRenderer()
axes = vtk.vtkAxesActor()

#axes.SetAxisLabels(0) # 0/1 to turn off/on axis labels

transform = vtk.vtkTransform()
transform.Translate(-1.0, -1.0, -1.0)
transform.Scale(0.75, 0.75, 0.75)
axes.SetUserTransform(transform)

tprop = vtk.vtkTextProperty()
#tprop.SetFontSize(6) # seems to be overriden by vtkCaptionActor2D
tprop.SetBold(1)
tprop.SetItalic(0)
tprop.SetColor(1.0, 1.0, 1.0)
tprop.SetOpacity(1.0)
tprop.SetFontFamilyToTimes()

for label in [
        axes.GetXAxisCaptionActor2D(),
        axes.GetYAxisCaptionActor2D(),
        axes.GetZAxisCaptionActor2D(),
        ]:
    # set Positoin2
    label.SetWidth(label.GetWidth() * 0.5)
    label.SetHeight(label.GetHeight() * 0.5)
    label.SetCaptionTextProperty(tprop)

renderer.AddActor(axes)

Interact()


On Sat, Apr 8, 2017 at 4:08 PM, Liang Wang <frank0...@gmail.com> wrote:

> From http://public.kitware.com/pipermail/paraview/2010-July/018081.html
> it was not possible back then to change the size of orientation axes.
>
> Is it possible now, hopefully through Python, too?
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview

Reply via email to