[Paraview] Need Python Chart help

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Fri Feb 21 15:42:51 EST 2014


Josh,

I believe you're missing a rep.UpdatePropertyInformation()  (and maybe
even rep.Update()) before accessing that property. FYI, this component
has already changed in git/master. You nolonger need to use
SeriesNamesInfo property to get the series list, the domain for the
SeriesVisibility property will have the appropriate list.

On Fri, Feb 21, 2014 at 3:39 PM, Joshua Murphy
<Joshua.Murphy at lasp.colorado.edu> wrote:
> 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
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>


More information about the ParaView mailing list