MantisBT - ParaView
View Issue Details
0008543ParaView(No Category)public2009-02-16 13:572016-07-26 17:16
Utkarsh Ayachit 
Utkarsh Ayachit 
normalminorhave not tried
closedfixed 
 
Someday 
0008543: Color bar from python
Make is easy to create/access scalar bar/color bar from python.
Convesation:
Ken: How do you turn on the color bar from Python?

Berk: Not easy to do....

Ken: Can we move the responsibility of scalar bar management to the representation object? That way, either the GUI or a python script need only turn on a flag in the representation and the lookup table and range will be set up for you. It could also satisfy a request from the mailing list to keep the scalar bar up (or down) when changing variables to color by.
No tags attached.
Issue History
2009-02-16 13:57Utkarsh AyachitNew Issue
2009-02-17 16:58Utkarsh AyachitStatusbacklog => tabled
2009-02-17 16:58Utkarsh AyachitAssigned To => Utkarsh Ayachit
2011-01-21 13:37Utkarsh AyachitTarget Version => Someday
2011-06-16 13:10Zack GalbreathCategory => (No Category)
2016-07-21 13:29Cory QuammenNote Added: 0036537
2016-07-21 13:29Cory QuammenStatusbacklog => closed
2016-07-21 13:29Cory QuammenResolutionopen => fixed
2016-07-25 22:49Cory QuammenStatusclosed => backlog
2016-07-25 22:49Cory QuammenResolutionfixed => reopened
2016-07-25 22:49Cory QuammenStatusbacklog => customer review
2016-07-25 22:49Cory QuammenResolutionreopened => fixed
2016-07-26 17:16Alan ScottNote Added: 0036615
2016-07-26 17:16Alan ScottStatuscustomer review => closed

Notes
(0036537)
Cory Quammen   
2016-07-21 13:29   
This is easy nowadays:

# create a new 'Sphere'
sphere1 = Sphere()

# get active view
renderView1 = GetActiveViewOrCreate('RenderView')

# show data in view
sphere1Display = Show(sphere1, renderView1)

# set scalar coloring
ColorBy(sphere1Display, ('POINTS', 'Normals'))

# show color bar/color legend
sphere1Display.SetScalarBarVisibility(renderView1, True)

# get color transfer function/color map for 'Normals'
normalsLUT = GetColorTransferFunction('Normals')

# get opacity transfer function/opacity map for 'Normals'
normalsPWF = GetOpacityTransferFunction('Normals')
(0036615)
Alan Scott   
2016-07-26 17:16   
Testing directions below miss a Render(). After using a Render, this worked correctly.

Tested local server, Linux, master.