Hi Dirk,

[adding the list in CC as there might be others with the same problem. I 
also stripped your screenshots because I do not know if they were 
confidential]

yes, there is a possibility to generate colorbars in color space "gray" 
by default. Interestingly, it is much more involved than I would like it 
to be (I added a todo note to improve things).

The following example would do the job:

%\pdfcompresslevel=0
\documentclass{standalone}

% This tells 'xcolor' to define every color in 'gray'.
\usepackage[gray]{xcolor}
\usepackage{pgfplots}

\pgfplotsset{
compat=1.9,
% tells pgfplots to use 'gray' for any *newly generated* colormap:
colormap default colorspace=gray,
%
% workaround for a weakness of PGF: PGF does not support non-RGB
% shadings. But shader=interp does. And: the outcome is visually the same.
% -> use shader=interp:
colorbar sampled={surf,shader=interp},
%
% 'colorbar sampled' reconfigures styles and sets colorbar=true.
% Set it back:
colorbar=false,
%
% install and define the default color map.
colormap/blackwhite,
}


\begin{document}

\begin{tikzpicture}
\begin{axis}[
colorbar,
]
\addplot[mesh] {x};
\end{axis}
\end{tikzpicture}
\end{document}


The instruction \pdfcompresslevel=0 (combined with pdflatex) allows to 
inspect the resulting pdf; the shading *did* use devicegray.

It seems, as if the combination of xcolor + pgfplots does not pick up 
\usepackage[gray]{xcolor} as it ought to do (it works for CMYK, 
interestingly). I will look into it why it failed.

Anyway; the preamble declarations above are part of the pgfplots stable 
API and should work for you. I added inline comments which will 
(hopefully) motivate their use; the manual contains references to each key.

Kind regards

Christian

PS
You may also want to declare

/pgfplots/mesh/colorspace explicit color output=gray

but this applies only to surface plots with explicit color.


Am 13.12.2013 18:08, schrieb Möller Dirk:
>
> Guten Tag Herr Feuersänger,
>
> pgfplot hat mir bereits super Dienste erwiesen, vielen Dank dafür.
>
> Sie schreiben, das der colorspace=gray einem rgb colorspace 
> entspricht. Gibt es die Möglichkeit einen grayscale colorspace zu 
> benutzten?
>
> Der Hintergrund ist der, dass mir ein „blackwhite colorbar“ ein 
> „Farbbild“ gibt das nur aus graustufen besteht (oberes Bild). Diese 
> werden wiederum unterschiedlich von Druckertreibern interpretiert. Im 
> Unterschied dazu ist das untere Bild ein „echtes“ Graustufenbild 
> (beide Plots enthalten ein Graustufenbild und sind daher bis auf den 
> colorbar schwarz-weiss Plots).
>
> Mit freundlichen Grüssen,
>
> Dirk
>
>
>
> -------------------------------------------------------
>
> ETH Zurich
> Dirk Möller
>
> IMES / Center of Mechanics
>
> CLA H31
> Tannenstrasse 3
>
> 8092 Zurich
> SWITZERLAND
>
> dirk.moel...@imes.mavt.ethz.ch <mailto:dirk.moel...@imes.mavt.ethz.ch>
> www.zfm.ethz.ch/e/micromanipulation 
> <http://www.zfm.ethz.ch/e/micromanipulation>
>
> +41 44 632 61 06 phone
>
> +41 44 632 11 45 fax
>


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Pgfplots-features mailing list
Pgfplots-features@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pgfplots-features

Reply via email to