[vtkusers] vtkAxisActor2D -- how to change its colour?

Amy Squillacote ahs at cfdrc.com
Mon May 19 10:11:57 EDT 2008


Hi Robert,

Once you get the vtkAxisActor2D from the vtkLegendScaleActor (e.g., 
using the GetRightAxis() method), you can modify the properties of the 
axis itself by calling GetProperty() on the vtkAxisActor2D and adjusting 
the parameters as necessary. In c++, the code to change the color of the 
right axis to black would look something like the following.

vtkLegendScaleActor *lsa = vtkLegendScaleActor::New();
...
lsa->GetRightAxis()->GetProperty()->SetColor(0, 0, 0);

- Amy

Atwood, Robert C wrote:
> Hi, I find that the vtkAxisActor2D member of vtkLegendScaleActor,  does
> exactly what I am wanting to include in my application, however with the
> little problem that the axis is white, whereas I want it to be black. 
>
> I can't see which function to use to alter this property, I'm not quite
> sure which member of the object this property belongs to. 
>
> I have no trobule changing the colour and other properties of the labels
> of the axis!
>
> Any little hint or pointer to example that uses this or very similar
> object to  draw a distance scale in the image  ?  (not like
> CubeAxesActor, I don't want it moving as the scene is rotated) 
>
> Thanks
> Robert
>
>
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>   

-- 
Amy Squillacote                    Phone: (256) 726-4839
Computer Scientist                 Fax: (256) 726-4806
CFD Research Corporation           Web: http://www.cfdrc.com
215 Wynn Drive, Suite 501
Huntsville, AL  35805





More information about the vtkusers mailing list