|
[Sponsors] |
[General] Python Scripting - Set Legend Label Color |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 22, 2018, 14:20 |
Python Scripting - Set Legend Label Color
|
#1 |
New Member
Martin
Join Date: Jan 2018
Posts: 3
Rep Power: 8 |
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! |
|
Tags |
python script |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
material for python scripting | amin.z | Pointwise & Gridgen | 4 | June 19, 2018 14:14 |
Ansa Python Scripting | Renu123 | ANSA | 1 | September 16, 2017 13:45 |
Ansys Licence Serve on Ubuntu 16.04 LTS | david.pasquale | ANSYS | 2 | January 20, 2017 12:52 |
Possible bug with stitchMesh and cyclics in OpenFoam | Jack001 | OpenFOAM Pre-Processing | 0 | May 21, 2016 09:00 |
Help with GNUPlot | Renato. | Main CFD Forum | 6 | June 6, 2007 20:51 |