[R] x y plot with z coordinate scaling to a color value
Felix Andrews
felix at nfrac.org
Thu May 20 03:53:41 CEST 2010
And made slightly easier with panel.levelplot.points from latticeExtra:
http://latticeextra.r-forge.r-project.org/#panel.levelplot.points
On 19 May 2010 22:24, baptiste auguie <baptiste.auguie at googlemail.com> wrote:
> Hi,
>
> See also ?lattice::xyplot and ?ggplot2::geom_point , either one can do
> it automatically.
>
> HTH,
>
> baptiste
> On 19 May 2010 12:24, Jannis <bt_jannis at yahoo.de> wrote:
>> Dears,
>>
>> before I start programming my own function I would like to ask you whether there is any function already available that lets me plot a x/y plot with the colors of the points determined by scaling a third variable z into a defined colorramp?
>>
>> Until now I am using a wild combination of functions to create a colorvector by hand, then calling
>>
>> plot(x,y,col=colors)
>>
>> and then using color.legend() from plotrix to add a colorbar. Is there anything where I can just call (for example)
>>
>> plot(x,y,z)
>>
>>
>> and get a plot and a colorbar next to it?
>>
>> If not I have to program that myself because my current way involves a lot of steps and readjusting plotting regions.
>>
>>
>> Thanks for your help!
>>
>> Jannis
>>
>>
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Felix Andrews / 安福立
Postdoctoral Fellow
Integrated Catchment Assessment and Management (iCAM) Centre
Fenner School of Environment and Society [Bldg 48a]
The Australian National University
Canberra ACT 0200 Australia
M: +61 410 400 963
T: + 61 2 6125 4670
E: felix.andrews at anu.edu.au
CRICOS Provider No. 00120C
--
http://www.neurofractal.org/felix/
More information about the R-help
mailing list