[Paraview] Need Python Chart help

Joshua Murphy Joshua.Murphy at lasp.colorado.edu
Fri Feb 21 15:39:48 EST 2014


Hello,

I am trying to set up some python helpers for working with line plots, and I am running into trouble.

I have the following code to setup a probe location, and then plot over time:

mainView = GetActiveView()

DensityChart = CreateXYPlotView()
DensityChart.AxisLabelFont = ['Times', '10', '0', '0', 'Times', '10', '0', '0', 'Times', '10', '0', '0', 'Times', '10', '0', '0']
DensityChart.AxisTitleFont = ['Times', '11', '0', '0', 'Times', '11', '0', '0', 'Times', '11', '0', '0', 'Times', '11', '0', '0']
DensityChart.AxisTitle     = ['Density $(N/cm^3)$', 'Modified Julian Date','','']
DensityChart.ChartTitle = 'Density at 1 AU (ACE) $(N/cm^3)$'
DensityChart.ChartTitleFont = ['Times', '14', '0', '0']

#Probe the Location at 1AU
SetActiveView(mainView)
SetActiveSource(InputFile)
Probe1AU = ProbeLocation(ProbeType="Fixed Radius Point Source")
Probe1AU.ProbeType.Center = [1.0, 0.0, 0.0]
Probe1AURep = Show()
Probe1AURep.Visibility = 0

SetActiveView(DensityChart)
SetActiveSource(Probe1AU)
Plot1AU = PlotSelectionOverTime()
Selection1AU = IDSelectionSource( ContainingCells=0, InsideOut=0, FieldType='POINT', IDs=[-1L, 0L] )
Plot1AU.Selection = Selection1AU

Plot1AURep = Show()

I now want to select a series to plot.  After looking though some of the python code in ParaView, and looking at sites online, I came up with this method of getting a list of series so I can set them on/off and set their colors, etc:

repView = GetActiveView()
rep = repView.Representations[0]
availableProps = rep.ListProperties()
prop = rep.GetProperty("SeriesNamesInfo")
print prop

If I do this from the the Python Shell after the first scrip above runs, it works great, and I get a list of all of the Series.

However, if I add this into the script, and then run, I always get  prop == None

I am obviously doing something wrong, and I have a sneaky suspicion it has something to do with fetching data from the server manager, but I am at a loss on how to get this work.

Could someone please point me in the correct direction?

I am using ParaView 4.0.1 for Mac.

Thanks,
Josh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20140221/b2039a43/attachment-0001.html>


More information about the ParaView mailing list