swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Density Graph, How?


From: Doug Donalson;
Subject: Re: Density Graph, How?
Date: Thu, 2 Oct 1997 15:46:21 -0700 (PDT)

I am assuming that by a density graph you mean that you want to plot the 
YX coordinates of your individuals as points in a square area.  I have 
done this two ways.  The first is using a scatterplot in S-plus.  This
works very nicely and some of these are included in a paper soon to be 
published in Ecology.  These were in my pre-SWARM days but the idea is 
the same.  At times that you want data, have a routine that goes through 
and has each agent write its position to a file.  Then have S-plus read 
in and plot the file.  

I also see no reason that you can't use the SWARM 2D plots to do the same 
thing.  If you choose a small enough resolution on a 2D plot than you can 
have a reasonable probability that 2 or more individuals will not end up in 
the same square.  You can then just assign two colors for each lattice point, 
occupied or unoccupied.  If you are dealing with a large number of 
individuals the resolution of any graph package will end up with overlap 
just like a lattice plot because there is a physical size to the point the 
printer plots.  

Cheers,

   Doug Donalson  
***************************************************************************
* Doug Donalson                          * Office: (805) 893-2962         *
* Ecology, Evolution, and Marine Biology * Home:   (805) 961-4447         *
* UC Santa Barbara                       * email address@hidden
* Santa Barbara Ca. 93106                *                                *
***************************************************************************
*                                                                         *
*   The most exciting phrase to hear in science, the one that             *
*   heralds new discoveries, is not "EUREKA" (I have found it) but        *
*   "That's funny ...?"                                                   *
*                                                                         *
*       Isaac Asimov                                                      *
*                                                                         *
***************************************************************************


On Tue, 30 Sep 1997, Jae Chan Oh wrote:

> Hi,
> I am trying to draw a sort of density graph (1-D or 2-D)
> given real-valued data. It basically should show how agents are
> distributed in a *contiguous* space. (discrete space wouldn't do, therefore)
> 
> I was thinking about BLT graph but I was wondering whether there is/are
> any better way to plot this information.
> 
> If anyone has a code fragment of doing this, please give me the pointer
> to it.
> 
> Thank you,
> 
> -Jae
> ---
> 
> 
>                 Jae C. Oh
>               315 Alumni Hall
>               Department of Computer Science
>               The University of Pittsburgh
>               Pittsburgh, PA 15260
> 
>                 Office: 315AL 624-8456
>                 WWW - http://www.cs.pitt.edu:80/~joh/
> 
> 
>                   ==================================
>    Swarm-Support is for discussion of the technical details of the day
>    to day usage of Swarm.  For list administration needs (esp.
>    [un]subscribing), please send a message to <address@hidden>
>    with "help" in the body of the message.
>                   ==================================
> 

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]