other-type-of-plots/questions.rst
author Puneeth Chaganti <punchagan@fossee.in>
Mon, 08 Nov 2010 11:00:08 +0530
changeset 405 ae4bcaff1dde
parent 289 3b801e60246a
permissions -rw-r--r--
Changes to progress.org.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
288
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
     1
Objective Questions
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
     2
-------------------
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
     3
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
     4
.. A mininum of 8 questions here (along with answers)
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
     5
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
     6
1. What is a log-log chart?
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
     7
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
     8
   a. A straight line graph
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
     9
   #. A graph on the logarithmic scale
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    10
   #. A graph on the logarithmic scale with different scales for x and
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    11
      y axes
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    12
   #. A graph in which x axis is represented in logarithmic scale.
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    13
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    14
Answer: A graph on the logarithmic scale with different scales for x
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    15
 	and y axes
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    16
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    17
2. We have two lists with us ``years`` and ``profit``, what statement
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    18
   can be issued to plot a pie chart to plot the profit for each year,
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    19
   and each wedge has to be labelled with the corresponding year.
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    20
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    21
Answer: pie(profit, labels=years)
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    22
289
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    23
3. We have two lists with us ``years`` and profit``, what statement
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    24
   can be issued to plot a scatter plot of the data in blue colored
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    25
   diamonds. ``years`` has to be plotted along x-axis.
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    26
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    27
Answer: scatter(year,profit,color='blue',marker='d')
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    28
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    29
4. ``scatter(x, y, color='blue', marker='d')`` and ``plot(x, y,
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    30
   color='b', marker='d')`` does exactly the same.
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    31
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    32
   a. True
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    33
   #. False
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    34
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    35
Answer: False
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    36
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    37
5. ``plot(x, y, 'bd')`` creates a scattered plot in blue color and
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    38
   diamond markers?
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    39
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    40
   a. True
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    41
   #. False
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    42
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    43
Answer: True
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    44
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    45
6. ``scatter(x, y, 'bd')`` creates a scatter plot in blue color with
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    46
   diamond markers.
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    47
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    48
   a. True
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    49
   #. False
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    50
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    51
Answer: False
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    52
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    53
7. What statement can be issued to generate a bar chart with 135\
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    54
   :sup:`o` hatched bar filled with white.
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    55
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    56
   a. bar(x, y, color='w', hatch='/')
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    57
   #. bar(x, y, color='w', hatch='\\')
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    58
   #. bar(x, y, color='w', hatch='\')
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    59
   #. bar(x, y, color='w', hatch='|')
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    60
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    61
Answer: bar(x, y, color='w', hatch='\\')
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    62
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    63
8. What statement can be issued to generate a bar chart with vertical
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    64
   line hatching.
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    65
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    66
   a. bar(x, y, color='w', hatch='/')
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    67
   #. bar(x, y, fill=False, hatch='\\')
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    68
   #. bar(x, y, fill=False, hatch='|')
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    69
   #. bar(x, y, color='w', hatch='\')
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    70
3b801e60246a added questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 288
diff changeset
    71
Answer: bar(x, y, fill=False, hatch='|')
288
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    72
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    73
Larger Questions
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    74
----------------
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    75
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    76
.. A minimum of 2 questions here (along with answers)
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    77
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    78
1. Plot a log-log chart of the equation y=4*x\ :sup:`2` + 3*x for x
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    79
   from -50 to 50.
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    80
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    81
2. Plot a bar chart which is filled with white color and which is
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    82
   hatched with 135\ :sup:`o` slanting lines for the data given in the
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    83
   `file(company A data) <company-a-data.txt>`_ which has years and
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    84
   profit percentage for each year.
a3b98b4c371e added few questions for other-type-of-plots.
Anoop Jacob Thomas<anoop@fossee.in>
parents:
diff changeset
    85