CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] Python Scripting - Set Legend Label Color

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 22, 2018, 13:20
Default Python Scripting - Set Legend Label Color
  #1
New Member
 
Martin
Join Date: Jan 2018
Posts: 3
Rep Power: 8
MTMILLS87 is on a distinguished road
Hello I am currently writing a python script to write out images from Paraview from those saved in a statefile. This works apart from the fact the Legend Labels are output as White (even though if the statefile is loaded in the GUI the text is Black on White). From my trawling through the internet it appears utilising GetColorTransferFunction() is preferred to do this. In a manner like:

try: paraview.simple
except: from paraview.simple import *
LoadState("test.pvsm")

for i in range(len(GetRenderViews())) :
RenderView = GetRenderViews()[i]
RenderView.Background = [1,1,1]
# rtDataLUT = GetColorTransferFunction(RenderView())
# rTDataLUTColorBar = GetScalarBar(rTDataLUT, RenderView())
# rTDataLUTColorBar.TitleColor = [0.0, 0.0, 0.0]
# rTDataLUTColorBar.LabelColor = [0.0, 0.0, 0.0]
filename = 'view'+str(i)+'.png'
WriteImage(filename,view=RenderView)

Where the commented out sections appear to be breaking my script currently with the message:

rtDataLUT = GetColorTransferFunction(RenderView())
NameError: name 'GetColorTransferFunction' is not defined


Has anyone else seen this or got a work around?

Cheers!
MTMILLS87 is offline   Reply With Quote

Reply

Tags
python script


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
material for python scripting amin.z Pointwise & Gridgen 4 June 19, 2018 13:14
Ansa Python Scripting Renu123 ANSA 1 September 16, 2017 12:45
Ansys Licence Serve on Ubuntu 16.04 LTS david.pasquale ANSYS 2 January 20, 2017 11:52
Possible bug with stitchMesh and cyclics in OpenFoam Jack001 OpenFOAM Pre-Processing 0 May 21, 2016 08:00
Help with GNUPlot Renato. Main CFD Forum 6 June 6, 2007 19:51


All times are GMT -4. The time now is 22:01.