Skip to content

pgfplots generating images in RGB colorspace no matter what you define #505

@pauloney

Description

@pauloney

This seems to be a bug, because you see all over the place recommendations to use

colormap/blackwhite

in the axis properties, to produce an image in the Gray colorspace, as seen https://tex.stackexchange.com/questions/194085/pgfplot-how-to-render-3dplot-with-colors-black-white-and-gray, but it does not work on this example, and it produces elements in RGB colorspace all over the PDF file.

\documentclass{report}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}

\begin{document}

\begin{tikzpicture}[scale=0.7]
  \begin{axis}[
    domain=0:4,
    samples=30,
    smooth,
    axis lines=center,
    xlabel={$K$}, ylabel={$L$}, zlabel={$f(K,L)$},
    xmin=0, xmax=5, ymin=0, ymax=5, zmin=0, zmax=5, 
    view={80}{30},
    colormap/blackwhite
    ]
    % Define the function to plot
    \def\f(#1,#2){#1^0.5 * #2^0.5}
    \addplot3 [surf] {\f(x,y)};
  \end{axis}
\end{tikzpicture}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions