我想定义多个颜色图。但是当我尝试这样做时
\pgfplotsset{
colormap={something}{
color(0cm)=(blue);
color(1cm)=(orange!75!red)
}
colormap={somethingelse}{
color(0cm)=(white);
color(1cm)=(orange!75!red)
}
}
我收到一个错误。(这有效):
\pgfplotsset{
colormap={something}{
color(0cm)=(blue);
color(1cm)=(orange!75!red)
}
}
有任何想法吗?
答案1
这是拼写错误,因为键值语法中的选项需要用逗号分隔。这样就可以了;
\pgfplotsset{
colormap={something}{
color(0cm)=(blue);
color(1cm)=(orange!75!red)
},%<---- comma here
colormap={somethingelse}{
color(0cm)=(white);
color(1cm)=(orange!75!red)
}
}