Skip to content

Latest commit

 

History

History
279 lines (159 loc) · 5.44 KB

lecture05.md

File metadata and controls

279 lines (159 loc) · 5.44 KB
title layout
Lecture 5
lecture

Data Visualization

## Matthew Turk ## Spring 2018 ## Lecture 5

Warm-Up Activity

  1. What is the visualization trying to show?
  2. What are its methods?
  3. What are the strengths / weaknesses?

http://www.vijayp.ca/movies/new_page.html


Today's Topics

  • Transformations
  • Colors
  • Color mapping
  • Data Characteristics
  • Choosing Visualizations

Transformations

Affine transformations satisfy:

$ \vec{y} = A\vec{x} + \vec{b} $


Transformations

Affine transformations satisfy:

$ \vec{y} = A\vec{x} + \vec{b} $

We can use these to accomplish:

  • Shifts

Transformations

Affine transformations satisfy:

$ \vec{y} = A\vec{x} + \vec{b} $

We can use these to accomplish:

  • Shifts
  • Rotations

Transformations

Affine transformations satisfy:

$ \vec{y} = A\vec{x} + \vec{b} $

We can use these to accomplish:

  • Shifts
  • Rotations
  • Scaling

Choosing a Visualization

When we are examining data, what can we look for?

  • Does this data describe a geometric object?
  • Are the data points connected to each other?
  • Can we describe data points with a fixed set of categories?
  • Is there a quantity associated with the data?
  • Are the datapoints continuous along one or more dimensions?

Categories and Continuity

Today we'll talk about representing things based on categories and based on continuities.


How Do Colors Work?

Rods (low-light) and cones (color) mediate vision. Humans have about 20 times as many rods (120 million) as cones (6 million).

https://upload.wikimedia.org/wikipedia/commons/e/e8/1414_Rods_and_Cones.jpg By OpenStax College CC BY 3.0, via Wikimedia Commons


Let's Try It

http://enchroma.com/test/instructions/


Color Matching Function


Responsivity Function


Color Palettes

  • Colorbrewer Categories
    • Sequential
    • Diverging
    • Qualitative
  • Resources:
  • colorbrewer.org
  • palettable (package)

Sequential Colormaps


Diverging Colormaps


Qualitative Colormaps

(See? Works better as discrete!)


It's full of colors

https://commons.wikimedia.org/wiki/File:16777216colors.png


HSV Wheel

https://commons.wikimedia.org/wiki/File:HSV_color_solid_cylinder.png

By HSV_color_solid_cylinder.png: SharkD derivative work: SharkD Talk [CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0) or GFDL (http://www.gnu.org/copyleft/fdl.html)], via Wikimedia Commons


Palette Mapping

Assign each value to a specific color or element.


Color Mapping

$f(v) \rightarrow (R, G, B)$

We can also re-map:

$f(v') \rightarrow (R, G, B)$

$v' = f(v)$

For instance, with logs or squares.


Color Mapping: Linear Mapping

We map from a range of values to (0, 1):

$ v' = (v - v_0)/(v_1 - v_0) $














Import Statement

  • The import statement loads and makes accessible
  • Python will search paths to find the script to import
    • sys.path is a list of these
    • Current directory may or may not be included
  • Modules are reusable collections of functions and scripts
  • The presence of an __init__.py file indicates something is a package
  • We will be building a module