Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fix Palette to certain values

540 views
Skip to first unread message

Olaf Schultz

unread,
Oct 6, 2010, 4:07:44 PM10/6/10
to
Moin moin,

maybe I've overread it in the help pm3d-section and the demo-files...but:

Is it possible to fix a palette to certain values?

Background:
A palette, which define the RGB-Value for color-temperature.
Actual:
set palette defined (1000 1.0000 0.0401 0.0000,1100 1.0000 0.0631
0.0000,1200 1.0000 0.0860 0.0000,1....... 0.3287 0.5031 1.0000,39400
0.3286 0.5030 1.0000,39500 0.3284 0.5028 1.0000,39600 0.3283 0.5027
1.0000,39700 0.3281 0.5026 1.0000,39800 0.3280 0.5025 1.0000,39900 0.3279
0.5024 1.0000,40000 0.3277 0.5022 1.000)

But the color floats as I set a boarder with cbrange, e.g.
set cbrange[1000:10000] than the palette is not any more the correct
color als cbrange [1000:40000] does it.

The not so nice hack is to define the palette in just the wanted
cbrange...

Greetings from Germany,

Olaf

Ingo Thies

unread,
Oct 8, 2010, 7:15:08 AM10/8/10
to
On 06.10.2010 22:07, Olaf Schultz wrote:

> set palette defined (1000 1.0000 0.0401 0.0000,1100 1.0000 0.0631
> 0.0000,1200 1.0000 0.0860 0.0000,1....... 0.3287 0.5031 1.0000,39400
> 0.3286 0.5030 1.0000,39500 0.3284 0.5028 1.0000,39600 0.3283 0.5027
> 1.0000,39700 0.3281 0.5026 1.0000,39800 0.3280 0.5025 1.0000,39900 0.3279
> 0.5024 1.0000,40000 0.3277 0.5022 1.000)
>
> But the color floats as I set a boarder with cbrange, e.g.
> set cbrange[1000:10000] than the palette is not any more the correct
> color als cbrange [1000:40000] does it.

Hmm, I am not sure whether I get the point. Do you wish to truncate the
palette to the range [1000:10000], i.e. skip all colors that would be
adressed to the values above 10000? Doesn't keeping cbrange already
[1000:40000] with data ranging only from 1000 to 10000 do what you want?

Or do you want to condense the map to [1000:10000]? This should also be
done by simply setting cbrange. Note that the values you assign the RGB
levels to are arbitrary, i.e. you could write

set palette defined (1 1.0000 0.0401 0.0000,1.100 1.0000 0.0631 0.0000
...40.000 0.3277 0.5022 1.000)

as well, or just something from 0 to 1. The scaling should be done via
cbrange automatically.

HTH

Ingo

Olaf Schultz

unread,
Oct 8, 2010, 12:55:31 PM10/8/10
to
On Fri, 08 Oct 2010 13:15:08 +0200, Ingo Thies wrote:

> On 06.10.2010 22:07, Olaf Schultz wrote:
>
>> set palette defined (1000 1.0000 0.0401 0.0000,1100 1.0000 0.0631
>> 0.0000,1200 1.0000 0.0860 0.0000,1....... 0.3287 0.5031 1.0000,39400
>> 0.3286 0.5030 1.0000,39500 0.3284 0.5028 1.0000,39600 0.3283 0.5027
>> 1.0000,39700 0.3281 0.5026 1.0000,39800 0.3280 0.5025 1.0000,39900
>> 0.3279 0.5024 1.0000,40000 0.3277 0.5022 1.000)
>>
>> But the color floats as I set a boarder with cbrange, e.g. set
>> cbrange[1000:10000] than the palette is not any more the correct color
>> als cbrange [1000:40000] does it.
>
> Hmm, I am not sure whether I get the point. Do you wish to truncate the
> palette to the range [1000:10000], i.e. skip all colors that would be
> adressed to the values above 10000? Doesn't keeping cbrange already
> [1000:40000] with data ranging only from 1000 to 10000 do what you want?

I want to define the coloring in one step from 1k K to 40k K, approx 500
points..., no problem.

But when I plot the data and point of interesst is e.g. only 2k K to 10k
K it should plot automically the colors which belong to that range...not
compress the colors, defined from 1k to 40k to 2k to 10k. Actual the for
me approved work around is only to generate a palette-defintion for
2k-10k, when only this should be defined within cbrange[2k:10k].



> Or do you want to condense the map to [1000:10000]? This should also be
> done by simply setting cbrange. Note that the values you assign the RGB
> levels to are arbitrary, i.e. you could write
>
> set palette defined (1 1.0000 0.0401 0.0000,1.100 1.0000 0.0631 0.0000
> ...40.000 0.3277 0.5022 1.000)
>
> as well, or just something from 0 to 1.

Thats' the problem. If I use cbrange[2k:10k] i get the color for 1k at 2k
and the color at 40k for 10k:-(

> The scaling should be done via
> cbrange automatically.

Is there a switch to deactivate this?

Olaf

Péter Juhász

unread,
Oct 8, 2010, 2:10:40 PM10/8/10
to

I don't know if this solves your problem, but you can set the zrange
(which controls the range the data is plotted in) and the cbrange
(which controls the colors) separately.

So if you know that your data lies in a limited range, e.g.
[2000:10000], set the zrange to that, but leave the cbrange as it is
(in your example, [1000:40000]), so that the endpoints of the palette
be at the correct values.

Péter Juhász

Olaf Schultz

unread,
Oct 8, 2010, 3:13:56 PM10/8/10
to
On Fri, 08 Oct 2010 11:10:40 -0700, Péter Juhász wrote:

> On Oct 6, 10:07 pm, Olaf Schultz <o.ne...@enhydralutris.de> wrote:
>> Moin moin,
>>
>> maybe I've overread it in the help pm3d-section and the
>> demo-files...but:
>>
>> Is it possible to fix a palette to certain values?
>>
>> Background:
>> A palette, which define the RGB-Value for color-temperature. Actual:
>> set palette defined (1000 1.0000 0.0401 0.0000,1100 1.0000 0.0631
>> 0.0000,1200 1.0000 0.0860 0.0000,1....... 0.3287 0.5031 1.0000,39400
>> 0.3286 0.5030 1.0000,39500 0.3284 0.5028 1.0000,39600 0.3283 0.5027
>> 1.0000,39700 0.3281 0.5026 1.0000,39800 0.3280 0.5025 1.0000,39900
>> 0.3279 0.5024 1.0000,40000 0.3277 0.5022 1.000)
>>

was just a small awk-script in the command line on
http://www.vendian.org/mncharity/dir3/blackbody/UnstableURLs/
bbr_color.html

>> But the color floats as I set a boarder with cbrange, e.g. set
>> cbrange[1000:10000] than the palette is not any more the correct color
>> als cbrange [1000:40000] does it.
>>
>> The not so nice hack is to define the palette in just the wanted
>> cbrange...
>>
>> Greetings from Germany,
>>
>> Olaf
>
> I don't know if this solves your problem, but you can set the zrange
> (which controls the range the data is plotted in) and the cbrange (which
> controls the colors) separately.
>
> So if you know that your data lies in a limited range, e.g.
> [2000:10000], set the zrange to that, but leave the cbrange as it is (in
> your example, [1000:40000]), so that the endpoints of the palette be at
> the correct values.

Thanks, yes, that works...

Just for note:
save the gnuplot to keep the palette makes from the 1000 above 0....40000
becomes 1...so:

set cbrange [1000:40000]
set palette defined (0 1.0 0.0401 0.0.... 1 0.3277 0.5022 1.000)
set zrange [1000:2000]

that works. Fine

Olaf

0 new messages