# Rescale data to custom range, but not just for colorscheme

**URL:** https://discourse.paraview.org/t/rescale-data-to-custom-range-but-not-just-for-colorscheme/11066
**Category:** ParaView Support
**Created:** [December 23, 2022, 7:25am UTC](https://discourse.paraview.org/t/rescale-data-to-custom-range-but-not-just-for-colorscheme/11066 "2022-12-23T07:25:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![s195t](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/54ee81/32.png) [@s195t](https://discourse.paraview.org/u/s195t)
#### Post date: [December 23, 2022, 7:25am UTC](https://discourse.paraview.org/t/rescale-data-to-custom-range-but-not-just-for-colorscheme/11066/1 "2022-12-23T07:25:44Z")

</div>

Dear everyone,

I have a pressure scalar field as a plane, to better visualize maxima and minima, I usually rescale the colorscheme to a range between -1 and 1 and then I play with the opacity mapping until I see only really low and really high zones as blobs.

Now, I would really like to put some contours on these blobs, but the data in itself is not scaled, so I can’t put contours directly on the normalized scale…  
Is there a way to rescale data to custom range with a calculator or something like that, so that I can put the contour on the range from -1 to 1 and not the original one?

Thanks a lot and happy festive days

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [December 26, 2022, 9:41am UTC](https://discourse.paraview.org/t/rescale-data-to-custom-range-but-not-just-for-colorscheme/11066/2 "2022-12-26T09:41:05Z")

</div>

The `Python Calculator` allows you to rescale a range of data to an arbitrary range. That is, the **Expression** in the `Python Calculator` would be as follows:

`(custom_max-custom_min)*(YourVariable-min(YourVariable))/(max(YourVariable)-min(YourVariable))+custom_min`

In particular, if `custom_max = 1` and `custom_min = -1`, the following can be written:

`2*(YourVariable-min(YourVariable))/(max(YourVariable)-min(YourVariable))-1`
