Tuesday, 24 January 2017

Kolkata Map


Geo Mapping


Basic Charts

1. Pie Chart
How Much Pizza I Ate Last NightMushroomsOnionsOlivesZucchiniPepperoni37.5%25%12.5%12.5%12.5%
ToppingSlices
Mushrooms3
Onions1
Olives1
Zucchini1
Pepperoni2

2. Donut Chart
My Daily ActivitiesWorkEatCommuteWatch TVSleep45.8%29.2%8.3%8.3%8.3%
TaskHours per Day
Work11
Eat2
Commute2
Watch TV2
Sleep7
3.  Histogram
Lengths of dinosaurs, in meters0102030405005101520
DinosaurLength
Acrocanthosaurus (top-spined lizard)12.2
Albertosaurus (Alberta lizard)9.1
Allosaurus (other lizard)12.2
Apatosaurus (deceptive lizard)22.9
Archaeopteryx (ancient wing)0.9
Argentinosaurus (Argentina lizard)36.6
Baryonyx (heavy claws)9.1
Brachiosaurus (arm lizard)30.5
Ceratosaurus (horned lizard)6.1
Coelophysis (hollow form)2.7
Compsognathus (elegant jaw)0.9
Deinonychus (terrible claw)2.7
Diplodocus (double beam)27.1
Dromicelomimus (emu mimic)3.4
Gallimimus (fowl mimic)5.5
Mamenchisaurus (Mamenchi lizard)21
Megalosaurus (big lizard)7.9
Microvenator (small hunter)1.2
Ornithomimus (bird mimic)4.6
Oviraptor (egg robber)1.5
Plateosaurus (flat lizard)7.9
Sauronithoides (narrow-clawed lizard)2
Seismosaurus (tremor lizard)45.7
Spinosaurus (spiny lizard)12.2
Supersaurus (super lizard)30.5
Tyrannosaurus (tyrant lizard)15.2
Ultrasaurus (ultra lizard)30.5
Velociraptor (swift robber)1.8
4.  Line Graph
Company PerformanceSalesExpenses200420052006200704008001,2001,600
YearSalesExpenses
20041,000400
20051,170460
20066601,120
20071,030540

Monday, 23 January 2017


Geo Visualization


Wednesday, 11 January 2017

South Asia

Visualization Class 2

 Introduction

ggplot is the grammar of graphics created by Hadley Wickham. It has significantly reduced the difficulty of creating plots. We create plots or graphics to understand the characteristics of the features that we’re going to use in modelling or simple understanding for business scenario. This post is created for people who are new to ggplot but have knowledge of R. To create the plots, we are going to use the data of iris setosa classification scenario.

Understanding qplot

qplot is used when we want to create a plot without much tweaking of graphics. We leave the graphics to the ggplot library’s default settings. And it gives more colourful plots when we compare with the default plot that we get in R.

Scatter Plot

# Plotting the Sepal length vs Petal Length of the iris dataset.
qplot(Sepal.Length, Petal.Length, data = iris)
# Plotting the same as above but also adding a new dimension.
qplot(Sepal.Length, Petal.Length, data = iris, color = Species)
# Adding one more dimension of size of the bubble or the point.
qplot(Sepal.Length, Petal.Length, data = iris, color = Species, size = Petal.Width)
# Adding a little bit more transparency effect to avoid showing the overlapping. Alpha has to be added to include the transparency parameter.
qplot(Sepal.Length, Petal.Length, data = iris, color = Species, size = Petal.Width, alpha = I(0.7))

Now we will Create Our own Dataset to visualise and learn different Features of ggplot.
movies = data.frame(
    director = c("spielberg", "spielberg", "spielberg", "jackson", "jackson"),
    movie = c("jaws", "avatar", "schindler's list", "lotr", "king kong"),
    minutes = c(124, 163, 195, 600, 187))
  
qplot(director, data = movies, geom = "bar", ylab = "movies", color = movie)
qplot(director, weight = minutes, data = movies, geom = "bar", ylab = "total length (min.)")
qplot(Sepal.Length, Petal.Length, data = iris, geom = "line", color = Species)
qplot(age, circumference, data = Orange, geom = "line",
    colour = Tree,  main = "How does orange tree circumference vary with age?")  
# We can also plot both points and lines.
qplot(age, circumference, data = Orange, geom = c("point", "line"), colour = Tree)