[Tex/LaTex] Meta data for marker size instead of colour


In pgfplots, is it possible to have meta data affect the size of markers instead of
their colour?

I am referring to the set of commands described in section 4.4.10 about
scatter plots in the pgfplots manual.

Here is one of the provided examples :

samples=50,scatter src=y]

Best Answer

Yes, by using the scatter/@pre marker code to adjust the value of mark size depending on \pgfplotspointmetatransformed (which by default contains the y value scaled to a range from 0 to 1000):


    scatter src=y,
    scatter/@pre marker code/.append style=
        {/tikz/mark size=2+\pgfplotspointmetatransformed/300}