strange colormap behaviour with postscript printing
Ben Abbott
bpabbott at mac.com
Sun Jan 18 13:35:39 CST 2009
On Jan 18, 2009, at 5:58 AM, Petr Mikulik wrote:
>> So IMHO this really can be considered a gnuplot bug.
>
> It was designed this way when I have implemented pm3d; there were
> only gray
> and rgbformulae palettes. The interpolated palette colours were
> added later.
> So let us tell postscript to respect interpolated colour palette
> preferentially to the colour/gray setting. Then the fix is a one-
> liner.
>
> In postscript file, change
> Color true and
> to
> Color InterpolatedColor or
>
> The patch for gnuplot source code is on sourceforge.
>
>> Another possibility that occurs to me is to convert the custom
>> color map
>> to a monochrome version and have gnuplot respect that?
>
> With the above patch, any custom palette will keep the defined
> colours and
> gnuplot will respect it.
>
>
> I think that Octave could pass the custom colormap() through a
> "rgb2gray()"
> function before printing to any monochromatic device (not just
> monochromatic
> postscript). Then the plots
> print('mono.ps', '-dps')
> print('color.ps', '-dpsc')
> will be same as in Matlab.
>
> ---
> PM
Petr,
I tried your patch
http://sourceforge.net/tracker2/?func=detail&aid=2516634&group_id=2055&atid=102055
Unfortunately, 'mono.ps' and 'color.ps' inverted images (using the
example below which accompanyied your patch).
a=1./hilb(42);
colormap(flipud(gray));
imagesc(a); colorbar
print('mono.ps', '-dps');
print('color.ps', '-dpsc');
So it appears to me that the problem persists.
Ben
More information about the Bug-octave
mailing list