# Logarithmic Slider with Decorator in Python Plugin

**URL:** https://discourse.paraview.org/t/logarithmic-slider-with-decorator-in-python-plugin/7655
**Category:** Development
**Tags:** python
**Created:** [July 20, 2021, 5:44pm UTC](https://discourse.paraview.org/t/logarithmic-slider-with-decorator-in-python-plugin/7655 "2021-07-20T17:44:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Jared\_Blanchard](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jared_blanchard/32/7174_2.png) [@Jared\_Blanchard](https://discourse.paraview.org/u/Jared_Blanchard)
#### Post date: [July 20, 2021, 5:44pm UTC](https://discourse.paraview.org/t/logarithmic-slider-with-decorator-in-python-plugin/7655/1 "2021-07-20T17:44:47Z")

</div>

So far, I’ve only seen decorators that allow for linear scale slide bars. Is there a logarithmic scale slide bar?

For example, I have a slide bar to scale a sphere. The growth rate is very high on the left side of the slide bar, and slows down as I reach the right side (1000). I would love to have a linear growth rate (hence a logarithmic slider). Any ideas?

```auto
    @smproperty.doublevector(name="R1Scale", default_values=1)
    @smdomain.doublerange(min=1, max=1000)
    def SetR1Scale(self, x):
        self.prim.SetRadius(x*self.R1)
        self.Modified()

```

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [August 3, 2021, 1:50pm UTC](https://discourse.paraview.org/t/logarithmic-slider-with-decorator-in-python-plugin/7655/2 "2021-08-03T13:50:38Z")

</div>

There is no logarithmic slider available in ParaView, I’m afraid.

---

<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: [August 3, 2021, 2:01pm UTC](https://discourse.paraview.org/t/logarithmic-slider-with-decorator-in-python-plugin/7655/3 "2021-08-03T14:01:52Z")

</div>

This would be a nice simple addition though.

---

<div class="post-metadata">

### Author: ![Jared\_Blanchard](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jared_blanchard/32/7174_2.png) [@Jared\_Blanchard](https://discourse.paraview.org/u/Jared_Blanchard)
#### Post date: [August 3, 2021, 2:23pm UTC](https://discourse.paraview.org/t/logarithmic-slider-with-decorator-in-python-plugin/7655/4 "2021-08-03T14:23:17Z")

</div>

Yes, I think it would be useful for a lot of situations. I made do with the following code.

```auto
    @smproperty.doublevector(name="Radius Scale 10ˣ", default_values=0) # semimajor axis
    @smdomain.doublerange(min=0, max=5)
    def SetRadiusScaling(self, R):
        self.radius_scale = 10**R
        self.compute_sphere()
        self.Modified()

```

This gives me a slider that will scale my sphere’s radius by 10^x. I could use `np.exp(R)` as well.
