# Trace, clip, color bar scale range

**URL:** https://discourse.paraview.org/t/trace-clip-color-bar-scale-range/1728
**Category:** ParaView Support
**Created:** [April 27, 2019, 6:21pm UTC](https://discourse.paraview.org/t/trace-clip-color-bar-scale-range/1728 "2019-04-27T18:21:54Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![yamartinezgomez](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/e5b9ba/32.png) [@yamartinezgomez](https://discourse.paraview.org/u/yamartinezgomez)
#### Post date: [April 27, 2019, 6:21pm UTC](https://discourse.paraview.org/t/trace-clip-color-bar-scale-range/1728/1 "2019-04-27T18:21:54Z")

</div>

Hello,

I am recording a trace for two vtk files (each vtk file has its own renderview window) that takes and saves pictures (screenshots) of three different camera positions. The first two camera positions have a different angle of the vtk files. The last camera position includes clipping both vtk files on the X Normal. During the trace, all three pictures have the same color bar range.

When I replay the trace (using the same vtk files), the first two pictures (without clipping) look the same as the trace. However, the last picture (including the clipping), displays a different coloring and scaling range.

Is there anything I should include in my trace to keep all pictures with the same color bar range.

I appreciate any help.

Yvon,

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [April 29, 2019, 7:15am UTC](https://discourse.paraview.org/t/trace-clip-color-bar-scale-range/1728/2 "2019-04-29T07:15:12Z")

</div>

Looks like a bug, you could still add the command to set coloring and scaling before the screenshot.

You may want to provide a simple way to reproduce the issue.

---

<div class="post-metadata">

### Author: ![yamartinezgomez](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/e5b9ba/32.png) [@yamartinezgomez](https://discourse.paraview.org/u/yamartinezgomez)
#### Post date: [April 29, 2019, 11:58am UTC](https://discourse.paraview.org/t/trace-clip-color-bar-scale-range/1728/3 "2019-04-29T11:58:01Z")

</div>

Mr. Westphal,

Thank you for your kind reply.

Would you mind helping me with where and what command should I activate before the screenshot? (There is a few that I do not know the difference between them).

I would greatly appreciate your feedback.

Thank you.

Yvon Martinez

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [April 29, 2019, 1:03pm UTC](https://discourse.paraview.org/t/trace-clip-color-bar-scale-range/1728/4 "2019-04-29T13:03:20Z")

</div>

It would be something like

```
# set scalar coloring
ColorBy(clip1Display, ('POINTS', 'RTData'))

# rescale color and/or opacity maps used to include current data range
clip1Display.RescaleTransferFunctionToDataRange(True, False)

# Rescale transfer function
rTDataLUT = GetColorTransferFunction('RTData')
rTDataLUT.RescaleTransferFunction(40.0, 250.0)

# Rescale transfer function
rTDataPWF = GetOpacityTransferFunction('RTData')
rTDataPWF.RescaleTransferFunction(40.0, 250.0)
```

---

<div class="post-metadata">

### Author: ![yamartinezgomez](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/e5b9ba/32.png) [@yamartinezgomez](https://discourse.paraview.org/u/yamartinezgomez)
#### Post date: [April 29, 2019, 2:56pm UTC](https://discourse.paraview.org/t/trace-clip-color-bar-scale-range/1728/5 "2019-04-29T14:56:23Z")

</div>

Mr. Westphal,

Thank you for your quick response.

The idea you have suggested in the previous email can potentially work. However, I am using this python script trace in a FOR LOOP to iterate over different “attributes” that have different scale ranges. For instance, if I set a specific value in the code you have provided, this would only work for the ‘RTData’. If I happen to have ‘DTData’, and ‘MTData’, I will most likely lose the value ranges for these other sets of attributes (the scale seems to be fixed for values between 40.0 to 250.0).

I was hoping that maybe if I click a button, i.e rescale to data range, could potentially help me with this issue. I do not want to use rescale to custom range since I would have to provide a manual input of hard values belonging to that specific attribute i.e ‘RTData’. I am looking to have some flexibility with the data ranges.

I very much appreciate any other ideas.

Thank you in advance.

Yvon,

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [April 29, 2019, 2:59pm UTC](https://discourse.paraview.org/t/trace-clip-color-bar-scale-range/1728/6 "2019-04-29T14:59:41Z")

</div>

For the first part, you can simply write this in python.

For the second part, the call is :  
`wavelet1Display.RescaleTransferFunctionToDataRange(False, True)`
