plotting-data/questions.rst
author Anoop Jacob Thomas<anoop@fossee.in>
Sun, 07 Nov 2010 19:47:26 +0530
changeset 399 3c16961361cd
parent 372 8e05616c4102
child 416 06ac45f4de88
permissions -rw-r--r--
reviewed plotting-data.
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
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    22
3. How do you plot points ?
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
322
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    29
4. What does the parameter 'o' do ?
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    30
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    31
   It plots large points.
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    32
399
3c16961361cd reviewed plotting-data.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 372
diff changeset
    33
.. #[[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
    34
   'o'), that makes the question simple]]
3c16961361cd reviewed plotting-data.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 372
diff changeset
    35
322
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    36
5. How do you plot error in Python?
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    37
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    38
   Using the function error bar.
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    39
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    40
6. How do I get large red colour dots on a plot?
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    41
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    42
   By passing the paramter 'ro'.
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    43
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    44
7. What are the parameters 'xerr' and 'yerr' in errorbar function for?
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    45
   
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    46
   xerr - List of error values of variable on x axis.
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    47
   yerr - List of error values of variable on y ayis.
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    48
   
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    49
8. How would you plot error bar with a line?
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    50
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    51
   The fmt parameter for a line will be '-'.
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    52
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    53
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
Larger Questions
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    57
----------------
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    58
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    59
.. A minimum of 2 questions here (along with answers)
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    60
372
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    61
1. Plot an errorbar for following experimental data.
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    62
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    63
   |  X    |  Y   | Xerr | Yerr  |
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    64
   | 154.9 | 8106 | 8.51 | 165.8 |
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    65
   | 154.3 | 8138 | 8.50 | 166.3 |
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    66
   | 148.7 | 8148 | 7.78 | 161.2 |
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    67
   | 149.6 | 8171 | 7.81 | 162.6 |
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    68
8e05616c4102 Added metadata to plotting-data script
amit
parents: 322
diff changeset
    69
in red colour with large dots
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
2. List the parameters for errorbar and their function?