小縣信也 | 18 Jan 09:11 2011
Picon

python script how to change Data Range

Hi paraviewers!

I tried to change Data Range of color bar by paraview python script.
But It didn't work.
Does someone know the reasson?
Is there another way to change Data Range in script?

Kind Regards,
Shinya

---------------------code which I rtied----------------------------------

ScalarBarWidgetRepresentation2 = CreateScalarBar( Title='p',
Position2=[0.13, 0.5], Enabled=1, LabelFontSize=12, LabelColor=[0.47,
0.47, 0.47], TitleFontSize=12, TitleColor=[0.47, 0.47, 0.47],
Position=[0.87, 0.25] )

1_p_PVLookupTable = GetLookupTableForArray( "p", 1, RGBPoints=[0.0,
0.0, 0.0, 1.0, 0.5, 1.0, 0.0, 0.0], ScalarRangeInitialized=1.0 )
ScalarBarWidgetRepresentation2.LookupTable = a1_p_PVLookupTable
Utkarsh Ayachit | 18 Jan 14:47 2011

Re: python script how to change Data Range

The arguments to GetLookupTableForArray() are only the default values,
when a new lookuptable is created. If one exists, then they don't make
any changes.
Change the RGBPoints explicitly as follows:

1_p_PVLookupTable.RGBPoints = [....]

Utkarsh

2011/1/18 小縣信也 <so0208jp <at> gmail.com>:
> Hi paraviewers!
>
> I tried to change Data Range of color bar by paraview python script.
> But It didn't work.
> Does someone know the reasson?
> Is there another way to change Data Range in script?
>
> Kind Regards,
> Shinya
>
> ---------------------code which I rtied----------------------------------
>
> ScalarBarWidgetRepresentation2 = CreateScalarBar( Title='p',
> Position2=[0.13, 0.5], Enabled=1, LabelFontSize=12, LabelColor=[0.47,
> 0.47, 0.47], TitleFontSize=12, TitleColor=[0.47, 0.47, 0.47],
> Position=[0.87, 0.25] )
>
> 1_p_PVLookupTable = GetLookupTableForArray( "p", 1, RGBPoints=[0.0,
> 0.0, 0.0, 1.0, 0.5, 1.0, 0.0, 0.0], ScalarRangeInitialized=1.0 )
> ScalarBarWidgetRepresentation2.LookupTable = a1_p_PVLookupTable
(Continue reading)

小縣信也 | 19 Jan 13:48 2011
Picon

Re: python script how to change Data Range

Utkarsh

Thank you for quick reply.
i succeeded to change the color bar.
Your advice was very helpful for me.

Regards,
Shinya

2011/1/18 Utkarsh Ayachit <utkarsh.ayachit <at> kitware.com>:
> The arguments to GetLookupTableForArray() are only the default values,
> when a new lookuptable is created. If one exists, then they don't make
> any changes.
> Change the RGBPoints explicitly as follows:
>
> 1_p_PVLookupTable.RGBPoints = [....]
>
> Utkarsh
>
> 2011/1/18 小縣信也 <so0208jp <at> gmail.com>:
>> Hi paraviewers!
>>
>> I tried to change Data Range of color bar by paraview python script.
>> But It didn't work.
>> Does someone know the reasson?
>> Is there another way to change Data Range in script?
>>
>> Kind Regards,
>> Shinya
>>
(Continue reading)


Gmane