|
From: sfeam <sf...@us...> - 2015-07-03 05:24:11
|
On Thursday, 02 July 2015 11:29:15 PM Juhász Péter wrote:
> Dear.all;
>
> Consider the result of the following script (on full screen if
> possible):
>
> #####################
> cutoff = 300
> set palette defined \
> (0 'white', cutoff-1 'pink',\
> cutoff '#7f0000', cutoff+5 '#ff0000',\
> cutoff+10 '#ff007f', cutoff+15 '#ff7f00',\
> cutoff+20 '#ffff00')
>
> set isosa 1000
> set xr [0:10]
> set yr [0:cutoff+20]
> set cbr [0:cutoff+20]
>
> plot '++' w image
> ######################
>
> This is actually a minimal version of a real script.
> The contrived looking palette is intended to show that variation in the
> data is only interesting as long as it's above the cutoff. The palette
> is rapidly changing above the cutoff, however, and this emphasizes the
> effect of the limited resolution of the colorbox.
>
>
> The culprit is apparently this line in
> draw_inside_color_smooth_box_bitmap in color.c:
>
> int steps = 128; /* I think that nobody can distinguish more colours
> drawn in the palette */
>
> Apparently this assumption is false, especially on large resolution
> bitmap terminals.
I think the comment is correct, 128 colors in a smooth gradient
is probably sufficient.
The artifact you see is not because of a limited number of colors,
since for most terminals there is no limit to the number of colors.
I think what you are noticing is that the colorbar is composed of
a fixed number of equal-sized rectangles.
> Would it be sensible to adjust the number of steps based on the space
> available (yes, I guess, on bitmap terminals, but what about
> vector-based ones)? Or perhaps to make it user-settable?
I don't think any constant number of steps will be correct,
user-settable or not.
What you want is to vary the size of the colorbar rectangles
depending on the local palette gradient. Or looked at another way,
each interval in a defined palette ("set palette defined") should
be split into a sufficient number of rectangles to create a
smooth gradient.
That sounds possible, but complicated.
I suppose the number of sub-rectangles should depend on the
resolution of the terminal, the span of the defined palette
interval (1 rectangle is sufficient for a solid color), and
the number of available colors if the terminal has a maximum
number of palette colors.
Ethan
>
> Péter Juhász
>
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> gnuplot-beta mailing list
> gnu...@li...
> Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
>
|