Transcript
  • 8/10/2019 Data Visualization: Slides Overview

    1/29

    Data Visualization

    CS 159.35/CS 295.S65

    Reina ReyesAteneo de Manila University

  • 8/10/2019 Data Visualization: Slides Overview

    2/29

    Tell (powerful) stories with (interesting) data.

  • 8/10/2019 Data Visualization: Slides Overview

    3/29

    Outline

    " Motivation

    " Examples

    " Process

    " Tools

    " Timeline

    " Demo

  • 8/10/2019 Data Visualization: Slides Overview

    4/29

    People are visual creatures.

  • 8/10/2019 Data Visualization: Slides Overview

    5/29

    Illustration: Opinion piece on the Pork Barrel Issue

    http://opinion.inquirer.net/61051/a-story-of-greed-and-abuse-of-power#ixzz2erDdHfuC%C2%A0

  • 8/10/2019 Data Visualization: Slides Overview

    6/29

    Numbers can tell the most fascinating stories, and this one has to do with greed and abuse of power: the servants of the people conspiring with eachother to steal from their masters in even greater, mind-boggling magnitudes.Start with P720 million. That is the total amount of the first pork barrel in the form of the Mindanao Development Fund (P480 million) and the VisayasDevelopment Fund (P240 million). Established in 1989 by President Cory Aquino, who finally gave in to the importuning (I have personal knowledgeof this) of politicians.Continue with P2.3 billion. This is the increase in the pork barrel in 1990, one year later. It is now called the Countrywide Development Fund (CDF),because the Luzon politicians also wanted to partake of the pork. Note, Reader, that hardly had President Cory offered a hand of help to thelegislators than they reached for her whole arm (and seemed to have gotten it). Between one year and the next, the pork barrel more than tripled.Fast forward to 1996, when this newspaper came out with an expos detailing how members of both the legislative and executive branches were

    dividing the pork among themselves, with the people, for whom the D in CDF was intended, allegedly getting, in the form of actual cost of theproject, as little as 7 percent and at most 40 percent of the funds intended for them. The restfrom 60 to 93 percentwas apparently being dividedamong the legislators (12-40 percent), the implementing agencies, the pre-bids and awards committees (plus the resident auditor), and the localgovernment units. Everybody had their hand in that pork barrel. As it turns out, the Deep Throat, the supplier of the information, was the sittingcongressman from Marikina, Romeo Candazo, who apparently could not stomach the situation.

    At this point, it is appropriate to compare the pork-sharing system then and in the recent past, assuming that so-called whistle-blower Benhur Luystestimony is as unimpeachable as Candazos was 17 years ago: The numbers show that a) the legislators share (although Luy was referring only tosenators, because it was the Senate blue ribbon committee holding the hearing) of the pork has gone up from 40 percent at most to a definite 50percent, not including the share of their chiefs of staff at 5 percent; b) the rest of the gang (implementing agencies, executive agencies) get 10percent; and c) the NGOs and/or their mastermind get 35 percent. Which means that all the foregoing got the priority with respect to assistance,while the objects of development got absolutely zero.Theres more to come. There of course was public outrage and public outcry then (as there is now). And the government listened then, as it seemsto be listening now. Apparently, reforms were promised, but when that was not enough, the CDF was abolished in 2000. Does that sound familiar?

    But, it was replaced. By the Priority Development Assistance Fund (PDAF). The same dogoops, pigwith a different collar, supposedly tighter, inthe form of much-ballyhooed safeguards with regard to type of projects, bidding, monitoring, vetting of NGOs, procedures, financial and liquidationrequirements, etc., etc. The same safeguards enumerated in the recent Commission on Audit report.But it would seem that, not content with PDAF, the legislators also introduced other forms of pork: The Various Infrastructure including Local Projects(VILP, also known as hard pork, to distinguish it from the PDAFs soft pork) came into being. The VILP, by the way, was more than double thePDAF, which means the pork barrel tripled in amount.Still not content with that, some legislators in the Arroyo administration realized that by reducing the assumed exchange rate for converting foreigndebt service into pesos, a lot of additional funds could be made available for congressional reallocation. Thus was born theCongressional Insertions (CI), which was more than double the VILP, and five times the PDAF.Now go to P83 billion. That was the amount of the pork barrel in 2009, which marks the 20th year of the pork barrel, and the almost-end of the

    Arroyo administration. The pork was composed of the PDAF appropriations of P10 billion; VILP, P23 billion; and CI, P50 billion.Now compare the 1989 and 2009 numbers: 1989, P720 million; 2009, P83 billion. The pork barrel had increased by a factor of One Hundred Fifteen(115, i.e., 83 billion is 115 times 720 million). Now bring in another statistic: the increase in the general level of prices between 1989 and 2009. Pricesin 2009 were, on the average, four times those of prices in 1989.In other words, while the general level of prices went up fourfold, the pork barrel ballooned to 115 times its original level. Hows that for greed? Note,Reader, that the legislators were getting a much larger share of a humongously larger pork barrel.

    Actually, the CI for 2010 amounted to an even larger P64 billion, but Gloria Arroyo gave a conditional vetoshe vetoed it unless funds other thanthe supposed savings from foreign exchange rates could be found. In spite of that, by the time the Aquino administration came in, at least one-thirdof the CI had been spent.It is to the credit of the present administration that it put a stop to the CI. It also folded the VILP into the PDAF for greater control (besides whichPublic Works Babes Singson didnt want the VILP in his budgetso he must have known the kind of hanky-panky that could take place).Unfortunately, this action was deliberately or unintentionally misunderstood, and P-Noy was accused of more than doubling the PDAF compared to

    Arroyo. See how statistics can be misinterpreted?The good news is that from a high of P83 billion in 2009, the pork barrel plummeted to about P25 billion in 2012 (alas, the hanky-panky continues).

    And it will be zero for 2014. But as we have seen, the PDAF is not the pork barrel. Until P-Noy says that he is abolishing the pork barrel, I will not besatisfied, and neither should anybody else. Weve been hoodwinked enough. Abolish the pork barrel. Not just the PDAF. Now.

  • 8/10/2019 Data Visualization: Slides Overview

    7/29

  • 8/10/2019 Data Visualization: Slides Overview

    8/29http://www.gmanetwork.com/news/story/326487/opinion/a-visual-evolution-of-the-pork-barrel

  • 8/10/2019 Data Visualization: Slides Overview

    9/29

    Putting the World in Perspective

    IncomeperPersonoftheWorld

    Life Expectancy of the World

    Liechtenstein

    Antigua&Barbuda

    Dominica

    Palau

    NauruTuvalu

    Seychelles

    St. Kitts& Nevis

    AndorraSan Marino

    Monaco

    St.Lucia

    Panama

    Sao Tomeand Principe

    Tonga

    Samoa

    Grenada

    Brunei

    Comoros

    Djibouti

    Equatorial Guinea

    Gabon

    Luxembourg

    Namibia

    Swaziland

    Timor-Leste

    Micronesia

    Trinidad and Tobago

    Albania

    Bhutan

    Kiribati

    Kosovo

    Cyprus

    Maldives

    Slovenia

    Suriname

    Belize

    Mauritius

    Bahamas

    Malta

    Vanuatu

    Montenegro

    Estonia

    Gambia

    Guinea-BissauLesotho

    Botswana

    Mongolia

    Oman

    Qatar

    Iceland

    Barbados

    BahrainCapeVerde

    Latvia

    SolomonIslands

    Macedonia

    Fiji

    Guyana

    Jamaica

    St.Vincentand G.

    Armenia

    Lithuania

    Uruguay

    Mauritania

    Moldova

    Kuwait

    Congo, Rep.

    Liberia

    Bosnia and H.Croatia

    Lebanon

    Israel

    Costa Rica

    Puerto Rico

    New Zealand

    Georgia

    Central African Rep.

    SwedenSingapore

    Norway

    Ireland

    Finland

    Austria

    Turkmenistan

    Slovak Rep.

    Kyrgyzstan

    Eritrea

    DenmarkTaiwan

    Papua New Guinea

    Hong Kong

    United Arab Emirates

    South Sudan

    Switzerland

    Hungary

    BelarusAzerbaijan

    Dom.R.

    Bulgaria

    Serbia

    Burundi

    Libya

    Nicaragua

    Palestine

    Sierra Leone

    Laos

    Benin

    Guinea

    Somalia

    Tajikistan

    Togo

    El Salvador

    Honduras ParaguayJordan

    Poland

    Bolivia

    Haiti

    Czech Rep.

    Portugal

    Tunisia

    Rwanda

    GreeceBelgium

    Cuba

    Chad

    Senegal

    Zimbabwe

    Zambia

    Cambodia

    Ecuador

    Guatemala

    BurkinaFaso

    MalawiNiger

    Mali

    Kazakhstan

    Netherlands

    Chile

    Romania

    Cameroon

    Sri Lanka

    Cote d'Ivoire

    Angola

    Madagascar

    Syria

    Australia

    Mozambique

    Yemen

    North Korea

    Afghanistan

    Ghana

    Nepal

    Sudan

    SaudiArabia

    PeruVenezuela

    Malaysia

    Morocco

    Uzbekistan

    Italy

    Spain

    UKGermany

    Canada

    France

    South Korea

    Philippines

    Vietnam

    Ethiopia

    Egypt

    IranTurkey

    Dem. Rep. Congo

    Thailand

    South Africa

    Myanmar

    Colombia

    Ukraine

    Tanzania

    Kenya

    Argentina

    Algeria

    Iraq

    Uganda

    ChinaBangladesh Indonesia

    Pakistan

    USA

    Russia

    Brazil

    Nigeria

    Japan

    Mexico

    India

    2011 data for all 193 UN Members and forHong Kong, Kosovo, Palestine, Puerto

    Rico and Taiwan.

    Documentation andversion for print at:

    3 orless

    10100

    1000millions

    Colour by region

    Size by population

    If you want to see more data visit:

    www.gapminder.org

    Free to copy, share and

    remix, but attribute to

    Gapminder Foundation.

    Version 11 September 2012

    map

    layoutbyPaoloFausone

    .//-

    GAPMINDER WORLD 2012Mapping the Wealth and Health of Nations

    Healthy

    Poor Rich

    Sick

    50

    500 1 000 2 000 20 0005 000 10 000 50 000

    60

    70

    80

    55

    65

    75

    in US Dollars

    (GDP/capita, PPP$ ination adjusted, log scale)

    iny

    e

    ars

    www.gapminder.org; also look for TED talks by Hans Rosling (highly recommended!)

    http://www.gapminder.org/http://www.gapminder.org/
  • 8/10/2019 Data Visualization: Slides Overview

    10/29

    Putting the Philippines in Perspective

  • 8/10/2019 Data Visualization: Slides Overview

    11/29

    Putting the Philippines in Perspective

  • 8/10/2019 Data Visualization: Slides Overview

    12/29

    Just for fun!

  • 8/10/2019 Data Visualization: Slides Overview

    13/29

    Just for fun!

  • 8/10/2019 Data Visualization: Slides Overview

    14/29

    Charts made by Kamel Makhloufi

    Each pixel represents a death (in the Iraq war):U.S. soldiers blue, Iraqi troops green,enemies grey, and civilians orange.

    http://melka.one.free.fr/
  • 8/10/2019 Data Visualization: Slides Overview

    15/29

    Start with questions

    " Who is your audience?

    " What questions do they have?

    " What answers do you find for them?

    " What other questions does it inspire?

    " What conversations will result?

    From Visual Analysis Best Practices: Simple Tips for Making Every Data Visualization Useful and Beautiful.

    Tableau Software White Paper. Available at: http://www.tableausoftware.com/asset/10-tips-to-create-useful-

    beautiful-visualizations

    http://www.tableausoftware.com/asset/10-tips-to-create-useful-beautiful-visualizations
  • 8/10/2019 Data Visualization: Slides Overview

    16/29

    Data Cake

    http://epicgraphic.com/data-cake/

  • 8/10/2019 Data Visualization: Slides Overview

    17/29

    Data Cake

    Get Data

    Check Data

    Clean Data

  • 8/10/2019 Data Visualization: Slides Overview

    18/29

    Data Cake

    Analyze Data

    Visualize Data

  • 8/10/2019 Data Visualization: Slides Overview

    19/29

    Data Cake

    Design Chart

    Design Graphic

    Write text for the reader

  • 8/10/2019 Data Visualization: Slides Overview

    20/29

    Data Cake

    Tell the story

    Get reader feedback

  • 8/10/2019 Data Visualization: Slides Overview

    21/29

    Tools

    " Out-of-the-Box Software

    " Microsoft Excel, Google Spreadsheet

    " Tableau Software (Public, Desktop, Server, Online)

    "

    Programming" Python, R

    " HMTL, Javascript and CSS, Flash and Actionscript

    " Illustration" Adobe Illustrator, Inkscape

    " Pen and paper

  • 8/10/2019 Data Visualization: Slides Overview

    22/29

    Tools

    " Maps

    " Google Maps, OpenStreetMaps (API)

    " Python, R

    " ModestMaps, Kartograph, MapBox

    " Big Data

    " Python, R

    " Hadoop

    " Databases - SQL, noSQL

  • 8/10/2019 Data Visualization: Slides Overview

    23/29

    Tools - for this class

    " Python

    " Matplotlib - matplotlib.org

    "

    d3 Javascript library" d3js.org

    http://d3js.org/
  • 8/10/2019 Data Visualization: Slides Overview

    24/29

    Timeline

    Python

    d3

  • 8/10/2019 Data Visualization: Slides Overview

    25/29

    Demo!

  • 8/10/2019 Data Visualization: Slides Overview

    26/29

    Homework

    Show and Tell - your favorite data visualization

    Bring your laptop - setup work environment

    (Python, etc.)

  • 8/10/2019 Data Visualization: Slides Overview

    27/29

  • 8/10/2019 Data Visualization: Slides Overview

    28/29

    Your first chart Import libraries:

    from numpy import *

    from matplotlib import pyplot as plt

    Define variables:

    xvar = array([1,2,3,4,5])

    yvar = xvar*2

    Make scatter plot of x vs. y

    plt.clf()

    plt.plot(xvar,yvar,ko)

  • 8/10/2019 Data Visualization: Slides Overview

    29/29

    Customize your plot

    plt.xlim((0,5))

    plt.ylim((0,5))

    Label your plot

    plt.xlabel(variable X)

    plt.ylabel(variable Y)

    plt.title(My first Python plot)

    Save to file

    plt.savefig(my_first_chart.png)

    Your first chart


Top Related