blog posts

databases (1) django (1) drupal (2) java (4) processing (7) wamp (1) yahoo pipes (1)

Tuesday, 11 January 2011

processing How to visualise a certain dataset using 1day array

void setup()

{

 size(400,400);

 smooth();


}



                   

                   


// create arrays to hold data results


// create one array to hold conservative data

// create a second array to hold data on labour

// create a third array to hold data on liberal democrates






void draw()

{


  

    fill(255,10);         

  rect(0,0,400,400);


 

    float test[] = {38.6, 35.9, 38.6};

       

     



  

          float Conservative[] =  {38.6, 33.7, 27.7};

          float Labour[] =  {35.9, 33.0, 31.1};

          float libdems[] = {38.6,32.8, 28.6};


    for(int i=0; i < Conservative.length; i++)

    {

   



      fill(0,0,255);

      ellipse(100,150*i+50,Conservative[i],Conservative[i]);

   

    }

 

    for(int i=0; i < Labour.length; i++)

    {

      fill(255,0,0);

      ellipse(200,150*i+50,Labour[i],Labour[i]);

   

    }

  

      for(int i=0; i < libdems.length; i++)

    {

      fill(255,255,0);

      ellipse(300,150*i+50,libdems[i],libdems[i]);

   

    }

 


 

 



}





No comments:

Post a Comment

Popular Posts