Hi Mike,

Your observation is correct: colorbar sampled simply changes the way the 
colorbar is displayed; it does not control the way colors are mapped 
into the colormap.

This is actually unsupported and would need to become a feature request.

What you can use is to employ the low-level interface for scatter plots 
to write such stuff on your own.

A related application can be found in the pgfplots manual (search for 
"Low-Level scatter plot interface Example"). Please refer to that 
section to see if that is something for you. For your convencience, here 
is a copy of the mentioned example (the manual contains explanations):

\begin{tikzpicture}
% Low-Level scatter plot interface Example:
% use three different marker classes
% 0% - 30%    : first class
% 30% - 60% : second class
% 60% - 100% : third class
\begin{axis}[
scatter/@pre marker code/.code={%
    \ifdim\pgfplotspointmetatransformed pt<300pt
       \def\markopts{mark=square*,fill=blue}%
    \else
       \ifdim\pgfplotspointmetatransformed pt<600pt
          \def\markopts{mark=triangle*,fill=orange}%
       \else
          \def\markopts{mark=pentagon*,fill=red}%
       \fi
    \fi
    \expandafter\scope\expandafter[\markopts]
},%
scatter/@post marker code/.code={%
    \endscope
}]
\addplot+[scatter,scatter src=y,
     samples=40]
    {sin(deg(x))};
\end{axis}
\end{tikzpicture}

Kind regards

Christian

Am 29.03.2013 12:58, schrieb Mike Hettich:
> Dear all,
>
> I hevaily use pgfplots for preparing graphs. I encountered a problem I
> was not able to solve yet. While it is possible to use the key "sampled"
> for the colorbar the respective data points in the plot are still
> linearly mapped onto the provided colormap. I have not found an option
> yet to force a discrete colormapping for the scatter plot, i.e. one
> color for a range of values instead of color interpolation. I hope you
> can provide some advice on how to solve this issue.
>
>
> Best regards
> Mike
>
> ------------------------------------------------------------------------------
> Own the Future-Intel(R) Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest. Compete
> for recognition, cash, and the chance to get your game on Steam.
> $5K grand prize plus 10 genre and skill prizes. Submit your demo
> by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
> _______________________________________________
> Pgfplots-features mailing list
> Pgfplots-features@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pgfplots-features


------------------------------------------------------------------------------
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
_______________________________________________
Pgfplots-features mailing list
Pgfplots-features@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pgfplots-features

Reply via email to