An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20140224/ac9b9bd9/attachment.pl>
scatter plot to contour plot
4 messages · azam jaafari, Duncan Murdoch, Clint Bowman +1 more
On 24/02/2014 12:45 PM, azam jaafari wrote:
Dear All I want to convert a scatter plot to a continuous contour plot. I have "x" as a variable and "y" as another variable. is there any package for this? can anybody halp me?
A contour plot of values associated with the points, or a contour plot of the density of the points? For the former, I think you want to use the akima package; for the density estimate, you could use kde2d from the MASS package. In either case, you need to compute the values of the function on a grid, then the contour() function can plot it. Duncan Murdoch
Azam,
If you also have z ~ f(x,y) you can produce contours.
Otherwise, you could look at package hexbin.
Clint
Clint Bowman INTERNET: clint at ecy.wa.gov
Air Quality Modeler INTERNET: clint at math.utah.edu
Department of Ecology VOICE: (360) 407-6815
PO Box 47600 FAX: (360) 407-7534
Olympia, WA 98504-7600
USPS: PO Box 47600, Olympia, WA 98504-7600
Parcels: 300 Desmond Drive, Lacey, WA 98503-1274
On Mon, 24 Feb 2014, azam jaafari wrote:
Dear All I want to convert a scatter plot to a continuous contour plot. I have "x" as a variable and "y" as another variable. is there any package for this? can anybody halp me? Thanks Azam [[alternative HTML version deleted]]
______________________________________________ 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.
In addition to the other responses, I'd like to suggest:
help.search('contour', package='graphics')
Since the graphics package comes with R, you don't necessarily need any
additional package for contouring. But you will need the akima package for
interpolation. Assuming you're doing a contour plot of values associated
with the points, as Duncan put it.
-Don
Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 2/24/14 9:45 AM, "azam jaafari" <azamjaafari at yahoo.com> wrote: > >Dear All > >I want to convert a scatter plot to a continuous contour plot. I have "x" >as a variable and "y" as another variable. >is there any package for this? >can anybody halp me? > >Thanks >Azam > [[alternative HTML version deleted]] > >______________________________________________ >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.