# Could not determine discrete values to use for annotations

**URL:** https://discourse.paraview.org/t/could-not-determine-discrete-values-to-use-for-annotations/6630
**Category:** ParaView Support
**Created:** [March 5, 2021, 5:55pm UTC](https://discourse.paraview.org/t/could-not-determine-discrete-values-to-use-for-annotations/6630 "2021-03-05T17:55:33Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![theodorebaltis](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/e480ec/32.png) [@theodorebaltis](https://discourse.paraview.org/u/theodorebaltis)
#### Post date: [March 5, 2021, 5:55pm UTC](https://discourse.paraview.org/t/could-not-determine-discrete-values-to-use-for-annotations/6630/1 "2021-03-05T17:55:33Z")

</div>

I’m trying to create a discrete color bar for my data.  
When I click “Interpret Values as Categories” in the Color Map Editor I am presented with this warning:

![image](https://discourse.paraview.org/uploads/default/original/2X/7/70d205a05182485de12b40e67ee7501e60025120.png)

Though my dataset consists of integers and has less than 32 discrete values.

I’m plotting by DebrisID.  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/b/b65fd1b83e8adc773fd7f65dce94b62f5d055ba0.png)

Am I missing something or is this a bug?

Thanks,  
Ted

---

<div class="post-metadata">

### Author: ![theodorebaltis](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/e480ec/32.png) [@theodorebaltis](https://discourse.paraview.org/u/theodorebaltis)
#### Post date: [March 5, 2021, 6:21pm UTC](https://discourse.paraview.org/t/could-not-determine-discrete-values-to-use-for-annotations/6630/2 "2021-03-05T18:21:30Z")

</div>

And since I have to create each entry manually, is there any API available through the Python Shell to make that easier?

Alternatively, I know I could separately generate an xml colormap and load that in. But I would still want to be able to quickly update the values/annotations on the fly with a simple for loop.

---

<div class="post-metadata">

### Author: ![theodorebaltis](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/e480ec/32.png) [@theodorebaltis](https://discourse.paraview.org/u/theodorebaltis)
#### Post date: [March 5, 2021, 8:05pm UTC](https://discourse.paraview.org/t/could-not-determine-discrete-values-to-use-for-annotations/6630/3 "2021-03-05T20:05:51Z")

</div>

Update:  
Found the API through a trace.

So I can easily set all the Values/Annotations I need, but generating the colors (even random ones) is more difficult.

I could sit there and click the “Add new entry” button over and over to auto-generate some colors, but that’s less than ideal, even for a work-around.  
Is there a way to access the “random” (I think it’s actually consistently random, starting with white, red, blue, green…) colors that this button produces so that I can replicate this behavior programmatically?

---

<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: [March 8, 2021, 9:04am UTC](https://discourse.paraview.org/t/could-not-determine-discrete-values-to-use-for-annotations/6630/4 "2021-03-08T09:04:10Z")

</div>

Please share your data ?

In any case, using a preconfigure color map should work, click on the “heart”.

---

<div class="post-metadata">

### Author: ![theodorebaltis](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/e480ec/32.png) [@theodorebaltis](https://discourse.paraview.org/u/theodorebaltis)
#### Post date: [March 8, 2021, 9:33pm UTC](https://discourse.paraview.org/t/could-not-determine-discrete-values-to-use-for-annotations/6630/5 "2021-03-08T21:33:01Z")

</div>

After more testing, I see it’s only this one dataset that has this issue.  
Unfortunately I cannot share it.

I’m trying to reproduce with one that I can.

The problem with the preconfigured discrete color maps is that they are obviously configured with a certain number of values/annotations, none of which match what I’m after.

In case I run into this again I plan on creating a map from scratch and saving it as a preset.

---

<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: [March 9, 2021, 2:04pm UTC](https://discourse.paraview.org/t/could-not-determine-discrete-values-to-use-for-annotations/6630/6 "2021-03-09T14:04:52Z")

</div>

> [@theodorebaltis](#):
>
> Is there a way to access the “random” (I think it’s actually consistently random, starting with white, red, blue, green…) colors that this button produces so that I can replicate this behavior programmatically?

These colors come from the KAAMS color map preset in ParaView. A quick and dirty way to access them is:

```python
lut = GetColorTransferFunction("dummy")
lut.ApplyPreset('KAAMS')
rgbColors = lut.IndexedColors
# rgbColors = [1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.63, 0.63, 1.0, 0.67, 0.5, 0.33, 1.0, 0.5, 0.75, 0.53, 0.35, 0.7, 1.0, 0.75, 0.5]

```

The list of colors returns contain interleaved RGB values (white, red, green, blue, etc.).
