plotting-data/questions.rst
author Puneeth Chaganti <punchagan@fossee.in>
Tue, 09 Nov 2010 16:16:55 +0530
changeset 424 19f49715e83f
parent 416 06ac45f4de88
permissions -rw-r--r--
Changes to progress.org.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
322
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
     1
Objective Questions
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
     2
-------------------
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
     3
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
     4
.. A mininum of 8 questions here (along with answers)
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
     5
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
     6
1. How do you declare a sequence of numbers in python?
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
     7
   Give example .
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
     8
   
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
     9
   Comma seperated numbers inside two square brackets.
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    10
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    11
   seq=[1.5,3.2,8.7]
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    12
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    13
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    14
2. Square the following sequence? 
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    15
   
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    16
   distance_values=[2.1,4.6,8.72,9.03].
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    17
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    18
   square(distance_values)
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    19
   
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    20
 
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    21
416
06ac45f4de88 Changed Plotting Data according to review
Amit Sethi
parents: 399
diff changeset
    22
3. How do you plot the data as points using plot function?
322
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    23
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    24
   By passing an extra parameter '.'.
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    25
399
3c16961361cd reviewed plotting-data.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 372
diff changeset
    26
.. #[[Anoop: It can better if asked as, How do you plot the data as
3c16961361cd reviewed plotting-data.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 372
diff changeset
    27
   points using plot function?]]
3c16961361cd reviewed plotting-data.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 372
diff changeset
    28
416
06ac45f4de88 Changed Plotting Data according to review
Amit Sethi
parents: 399
diff changeset
    29
4. Can you comment about the result of this plot command .
06ac45f4de88 Changed Plotting Data according to review
Amit Sethi
parents: 399
diff changeset
    30
   plot(x, y,'o')
06ac45f4de88 Changed Plotting Data according to review
Amit Sethi
parents: 399
diff changeset
    31
322
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    32
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    33
   It plots large points.
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    34
399
3c16961361cd reviewed plotting-data.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 372
diff changeset
    35
.. #[[Anoop: give an example and ask what it does, like plot(x, y,
3c16961361cd reviewed plotting-data.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 372
diff changeset
    36
   'o'), that makes the question simple]]
3c16961361cd reviewed plotting-data.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 372
diff changeset
    37
322
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    38
5. How do you plot error in Python?
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    39
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    40
   Using the function error bar.
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    41
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    42
6. How do I get large red colour dots on a plot?
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    43
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    44
   By passing the paramter 'ro'.
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    45
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    46
7. What are the parameters 'xerr' and 'yerr' in errorbar function for?
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    47
   
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    48
   xerr - List of error values of variable on x axis.
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    49
   yerr - List of error values of variable on y ayis.
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    50
   
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    51
8. How would you plot error bar with a line?
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    52
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    53
   The fmt parameter for a line will be '-'.
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    54
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    55
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    56
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    57
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    58
Larger Questions
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    59
----------------
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    60
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    61
.. A minimum of 2 questions here (along with answers)
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    62
372
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    63
1. Plot an errorbar for following experimental data.
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    64
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    65
   |  X    |  Y   | Xerr | Yerr  |
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    66
   | 154.9 | 8106 | 8.51 | 165.8 |
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    67
   | 154.3 | 8138 | 8.50 | 166.3 |
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    68
   | 148.7 | 8148 | 7.78 | 161.2 |
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    69
   | 149.6 | 8171 | 7.81 | 162.6 |
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    70
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    71
in red colour with large dots
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    72
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    73
2. List the parameters for errorbar and their function?