Download presentation
Presentation is loading. Please wait.
Published byKathlyn Clarke Modified over 6 years ago
5
def plotDrugData4(data, data1, color, name, name1):
plot(data, data1, color) show() xlabel(name) ylabel(name1) title(name + ' versus ' + name1) # this function takes five inputs: # x, y: the data to be plotted # format: the line format # xtitle, ytitle: the labels for the x and y data def Versus(x, y, format, xtitle, ytitle): plot(x, y, format) # make the plot # label the axes and create the title xlabel(xtitle) ylabel(ytitle) title(xtitle + ' versus ' + ytitle) show() # show the graph
6
Producing a Visualization
CMSC 120: Visualizing Information Lecture 2/19/08
7
Object Review Data type Methods Knows stuff: data Does stuff: methods
Constructor: Modifier: Accessor: myFigure = figure(1) myFigure.set_facecolor('g') myFigure.savefig('myfig.pdf')
8
('My Window Title', <xsize>, <ysize>)
The Paper myWindow = GraphWin() ('My Window Title', <xsize>, <ysize>)
9
Graphics Windows (0,0) (xsize, ysize)
Coordinate System: description of the position of a point in space Origin: fixed point of reference; place where the axes of the system intersect
10
Graphics Windows Methods Colors: <window-name>.close()
<window-name>.getMouse() <window-name>.setBackground('color') Colors: 'red' 'purple' 'green ' 'cyan' 'blue' 'red1', 'red2', 'red3'
11
The Pen: Graphics Objects
Point Line Rectangle Oval Circle Polygon Text
12
Constructors <name> = Point(<x>, <y>) <name> = Line(<point1>, <point2>) <name> = Rectangle(<point1>, <point2>) <name> = Circle(<point>, <radius>) <name> = Oval(<point1>, <point2>) <name> = Text(<point>, 'text-string')
13
Modifiers <name>.setFill('color')
<name>.setOutline('color') <name>.setWidth(<num-pixels>) <name>.move(<x>, <y>)
14
Accessors <name>.draw(<window-name>)
<point-name>.getX() <point-name>.getY() <line-name>.getP1() <line-name>.getP2() <circle-name>.getCenter()
15
Information Visualization
Symbolic Display Graphs Charts Maps Diagrams
16
Graphs are Axes Content Labels
Diagrams that illustrate a relationship between two sets of numbers using symbols Axes Scale Dimensionality Content Points Lines Labels
17
<window-name>.setCoords(xll, yll, xur, yur)
Axes The framework <window-name>.setCoords(xll, yll, xur, yur) ll = lower left ur = upper right Graphics Window Origin of Window Coordinates? Origin of Graph
18
Graphs are Axes Content Labels
Diagrams that illustrate a relationship between two sets of numbers using symbols Axes Scale Dimensionality Content Points Lines Labels
19
Univariate visualization
20
Univariate Data A single variate Characterize Observations Number Type
Similarity
21
Types of Data Qualitative: pertaining to fundamental or distinctive characteristics Nominal: unordered (e.g., names, types) Ordinal: ordered (e.g., cold, warm, hot) Quantitative: pertaining to an amount of anything Discrete: isolated intervals Continuous: unbroken, immediate connection
22
Frequency Table Groups observations by class
Quantitative: an interval or part of the range of the sample Qualitative: a potential value Frequency: number of observations that fall into a class Relative Frequency: frequency / sample size
23
Weather Conditions: 2/17/08
24
Frequency Table Clear 5 17 % Mostly Cloudy 1 3 % Partly Cloudy 3 10 %
Condition Frequency Relative Frequency Clear 5 17 % Mostly Cloudy 1 3 % Partly Cloudy 3 10 % Overcast 16 55 % Light Rain 4 14 %
25
Frequency Table 25-30 7 24% 30-35 1 3% 35-40 3 10% 40-45 45-50 13 45%
Temperature Frequency Relative Frequency 25-30 7 24% 30-35 1 3% 35-40 3 10% 40-45 45-50 13 45% 50-55 0 % 55-60 3 % 60-65
26
Dot Plot N ≤ 20
27
Stem and Leaf Plots Stem Leaf 2 5566789 3 1567 4 02555566677788999 5 8
Temperature 25 26 27 31 36 40 42 Stem Leaf 2 5 Stem Leaf 2 3 1567 4 5 8 6 Stem Leaf 2 5567 Separate each number into a stem (class) and a leaf Group numbers with the same stems
28
Pie Charts Relative Frequency Must sum to 100%
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.