Graphical Perception as a Basis for Drawing Graphs. Ross Ihaka University of Auckland

Similar documents
CBIR: Colour Representation. COMPSCI.708.S1.C A/P Georgy Gimel farb

Overview. Raster Graphics and Color. Overview. Display Hardware. Liquid Crystal Display (LCD) Cathode Ray Tube (CRT)

Outline. Quantizing Intensities. Achromatic Light. Optical Illusion. Quantizing Intensities. CS 430/585 Computer Graphics I

Colour Image Segmentation Technique for Screen Printing

GIS Tutorial 1. Lecture 2 Map design

Computer Vision. Color image processing. 25 August 2014

Choosing Colors for Data Visualization Maureen Stone January 17, 2006

the points are called control points approximating curve

Expert Color Choices for Presenting Data

Escaping RGBland: Selecting Colors for Statistical Graphics

MA 323 Geometric Modelling Course Notes: Day 02 Model Construction Problem

DESIGN ELEMENTS OF DESIGN

A simpler version of this lesson is covered in the basic version of these teacher notes.

Assessment. Presenter: Yupu Zhang, Guoliang Jin, Tuo Wang Computer Vision 2008 Fall

(Refer Slide Time: 1:42)

Classroom Tips and Techniques: The Student Precalculus Package - Commands and Tutors. Content of the Precalculus Subpackage

Color. & the CIELAB. System

STT315 Chapter 4 Random Variables & Probability Distributions KM. Chapter 4.5, 6, 8 Probability Distributions for Continuous Random Variables

Perception of Light and Color

THE BASICS OF COLOUR THEORY

Georgia Department of Education Kathy Cox, State Superintendent of Schools 7/19/2005 All Rights Reserved 1

L 2 : x = s + 1, y = s, z = 4s Suppose that C has coordinates (x, y, z). Then from the vector equality AC = BD, one has

Diverging Color Maps for Scientific Visualization

UNDERSTANDING DIFFERENT COLOUR SCHEMES MONOCHROMATIC COLOUR

VISUAL ARTS VOCABULARY

CS 325 Computer Graphics

Processing the Image or Can you Believe what you see? Light and Color for Nonscientists PHYS 1230

Digital Image Basics. Introduction. Pixels and Bitmaps. Written by Jonathan Sachs Copyright Digital Light & Color

H.Calculating Normal Vectors

Diagrams and Graphs of Statistical Data

Important Notes Color

1. Introduction to image processing

Diverging Color Maps for Scientific Visualization (Expanded)

PLOTTING DATA AND INTERPRETING GRAPHS

Chapter 3 RANDOM VARIATE GENERATION

At the core of this relationship there are the three primary pigment colours RED, YELLOW and BLUE, which cannot be mixed from other colour elements.

Prentice Hall Mathematics: Algebra Correlated to: Utah Core Curriculum for Math, Intermediate Algebra (Secondary)

Jitter Measurements in Serial Data Signals

Advanced Computer Graphics. Rendering Equation. Matthias Teschner. Computer Science Department University of Freiburg

Phase Portraits for u = A u

Exam 1 Sample Question SOLUTIONS. y = 2x

. Address the following issues in your solution:

HSI BASED COLOUR IMAGE EQUALIZATION USING ITERATIVE n th ROOT AND n th POWER

Chapter 5: Working with contours

Current Standard: Mathematical Concepts and Applications Shape, Space, and Measurement- Primary

Fixed Point Theorems

Module1. x y 800.

Calibration Best Practices

Color Balancing Techniques

3 hours One paper 70 Marks. Areas of Learning Theory

GRID AND PRISM SPECTROMETERS

The Information Processing model

SolidWorks Implementation Guides. Sketching Concepts

8.2 Cells and Energy. What is photosynthesis? Photosynthesis takes place in the chloroplasts. CHAPTER 8. Solar cells and chloroplasts

Grade 6 Mathematics Assessment. Eligible Texas Essential Knowledge and Skills

DATA LAYOUT AND LEVEL-OF-DETAIL CONTROL FOR FLOOD DATA VISUALIZATION

South Carolina College- and Career-Ready (SCCCR) Pre-Calculus

ANALYTICAL METHODS FOR ENGINEERS

Improved predictive modeling of white LEDs with accurate luminescence simulation and practical inputs

Prentice Hall Algebra Correlated to: Colorado P-12 Academic Standards for High School Mathematics, Adopted 12/2009

Section 1.1. Introduction to R n

Blender 3D Animation

The Contribution of Street Lighting to Light Pollution

A Strategy for Teaching Finite Element Analysis to Undergraduate Students

1 if 1 x 0 1 if 0 x 1

2008 AP Calculus AB Multiple Choice Exam

Using Image J to Measure the Brightness of Stars (Written by Do H. Kim)

Birmingham City Schools

Understanding Poles and Zeros

In mathematics, there are four attainment targets: using and applying mathematics; number and algebra; shape, space and measures, and handling data.

REAL TIME TRAFFIC LIGHT CONTROL USING IMAGE PROCESSING

MATH 132: CALCULUS II SYLLABUS

LAYOUT OF THE KEYBOARD

NEW YORK STATE TEACHER CERTIFICATION EXAMINATIONS

CS 4620 Practicum Programming Assignment 6 Animation

A Proposal for OpenEXR Color Management

Arrangements And Duality

TOPIC 4: DERIVATIVES

GeoGebra. 10 lessons. Gerrit Stols

COOL ART WITH MATH & SCIENCE OPTICAL ILLUSIONS CREATIVE ACTIVITIES THAT MAKE MATH & SCIENCE FUN FOR KIDS! A NDERS HANSON AND ELISSA MANN

Multivariate data visualization using shadow

The Effects of Start Prices on the Performance of the Certainty Equivalent Pricing Policy

Solutions for Review Problems

Dear Accelerated Pre-Calculus Student:

ELEMENTS OF ART & PRINCIPLES OF DESIGN

Visualizing of Berkeley Earth, NASA GISS, and Hadley CRU averaging techniques

Derive 5: The Easiest... Just Got Better!

Visualizing Multidimensional Data Through Time Stephen Few July 2005

Vector Spaces; the Space R n

A QUICK GUIDE TO THE FORMULAS OF MULTIVARIABLE CALCULUS

Logo Symmetry Learning Task. Unit 5

Estimated Pre Calculus Pacing Timeline

Computer Graphics. Geometric Modeling. Page 1. Copyright Gotsman, Elber, Barequet, Karni, Sheffer Computer Science - Technion. An Example.

Electrical Resonance

Visualization of 2D Domains

Harmonic oscillations of spiral springs Springs linked in parallel and in series

Lecture 2. Marginal Functions, Average Functions, Elasticity, the Marginal Principle, and Constrained Optimization

Color Theory for Floral Design

THE NATURE OF LIGHT AND COLOR

Worksheet 1. What You Need to Know About Motion Along the x-axis (Part 1)

Transcription:

Graphical Perception as a Basis for Drawing Graphs Ross Ihaka University of Auckland

Outline Scope of the talk Colour choice for area fills Drawing smooth curves Extension to piecewise smooth curves

Colour Choosing colours that work together is hard! Relying on judgement or taste is very unreliable for most of us. Choosing colours for data graphics is even harder, because badly chosen colours may not just look horrible, they can also be misleading.

The Irradiation Illusion

Simultaneous Contrast

Colour Theory 101 The normal human eye has three colour receptors with peak sensitivities in the red, green, and blue regions of the spectrum. A sensation of colour can be produced stimulating the red, green and blue receptors with pure (single wavelength) colours at the peak sensitivity of each kind of receptor. This permits an external description of colour by the amount of each primary used to produce the colours. RGB: the amounts of red, green, and blue light used to produce the colour. HSV: a mapping of RGB into hue, saturation and value that correlates better with our perception of colour in terms of hue (colour of the rainbow), purity (red vs pink) and brightness (light vs dark) of colours.

Colour Theory 101 A better understanding of colour can be gained by understanding how the vision system processes colour. Internal circuitry converts the signals from the receptors into light-dark, yellow-blue and red-green signals. Transformation of the yellow-blue and red-green signals to polar coordinates converts them to our perceptual notions of colour-hue and colour purity. The mapping of colour stimulus to perceived colours is highly non-linear. It is useful to try to mimic this non-linearity to match the way that we see colours.

Perception of Colour The use of RGB and HSV spaces does not yield a faithful representation of the way in which we perceive colour. It is useful to apply a non-linear transformation to the three-dimensional colour space to make it more perceptually uniform. Euclidean distances in the transformed space provide a measure of perceptual distances. Pairs of colours the same distance apart in the space will appear equally similar. A number of spaces have been defined which provide perceptually uniform representations of colour that can be transformed in RGB or other colour specifications.

Uniform Colour Spaces CIELAB is used in the printing industry (subtractive colour applications) CIELUV is used in lighting applications (additive colour) CIEUVW is an attempt to be even more perceptually uniform. Use of these spaces makes it possible to specify colour in a way that matches human perception.

LUV Space

Horizontal Slices of LUV Colours on each of the circles differ only in hue.

Choosing Fill Colours Choose a set of colours that are equally bright and equally colourful. This ensures that we view the colours without bias. Equal brightness eliminates illumination illusion effects. Equal colourfulness means the eye is not preferentially drawn to particular areas. There is also a useful side-effect of choosing colours in this way...

Colour Harmony Choosing colours that work together harmoniously is hard. A few people have an innate ability to do this, but most of us don t. In the course of teaching painting at art school, Albert Munsell quantified a set of rules for producing harmonious colours. The essence of these rules is to choose colours equally spaced along smooth curves in a perceptually uniform colour space. The proposed method of choosing colours fits this principle.

Equally-Spaced HSV Colours

Equally-Spaced HSV Colours The circus wheel and poster, although they yell successfully for momentary attention, soon become so painful to the vision that we turn from them. Albert Munsell

Equally-Spaced Harmonious Colours The following colours were chosen using the R hcl function. A Six Colour Palette (L = 85, C = 35)

Equally-Spaced Harmonious Colours Darker, more colourful colours chosen using the R hcl function. A Six Colour Palette (L = 75, C = 55)

Computer Science PhD Graduates 30 25 Fall Summer Spring Winter 20 Students 15 10 5 0 72 73 74 75 76 77 78 79 80 81 82 83 84 85 Year Equispaced colours, full circle. hcl(h = 30 + seq(0, 360, length=5)[1:4], 35, 85)

Computer Science PhD Graduates 30 25 Fall Summer Spring Winter 20 Students 15 10 5 0 72 73 74 75 76 77 78 79 80 81 82 83 84 85 Year Equispaced colours, half circle. hcl(h = seq(60, 240, by = 60), 35, 85)

Computer Science PhD Graduates 30 25 Fall Summer Spring Winter 20 Students 15 10 5 0 72 73 74 75 76 77 78 79 80 81 82 83 84 85 Year Metaphorical colours. csphd(hcl(h = seq(210, 60,length = 4), 35, 85))

Computer Science PhD Graduates 30 25 Fall Summer Spring Winter 20 Students 15 10 5 0 72 73 74 75 76 77 78 79 80 81 82 83 84 85 Year Cool colours. hcl(h = seq(120, 0, length = 4) + 150, 35, 85)

Computer Science PhD Graduates 30 25 Fall Summer Spring Winter 20 Students 15 10 5 0 72 73 74 75 76 77 78 79 80 81 82 83 84 85 Year Warm colours. hcl(h = seq(120, 0, length = 4) - 30, 35, 85)

Drawing Smooth Curves Given an arbitrary function f and an interval [a,b], I want to have an automatic procedure that will draw the graph of the function over the interval. Using the procedure should be as easy as this. plot(f, a, b) At this level of generality the problem is hard but, for more restricted classes of function, progress can be made. This talk will mostly consider smooth (i.e. differentiable) functions but will also mention piecewise-smooth functions.

Curves and Polylines In computer graphics, a polyline is a connected set of line segments. A standard method for drawing parametric curves in a vector drawing system uses a polyline approximation based on (many) equally-spaced parameter values. Drawing the graph of a function f (x) over an interval [a,b] is an important special case. This is the method used in the R function curve, which uses 101 equally-spaced points by default.

A Smooth Function

A Smooth Function

A Smooth Function

A Smooth Function Absolute Error

What Makes a Polyline Approximation Good? Even when the accuracy of the polyline approximation is good, it may not look right because it is clearly not a smooth curve. This is because the visual system detects the corners at the joins of the segments making up the polyline. This is very much like the edge-detection process built into the visual system. The real issue here is one of visual perception rather than mathematical accuracy.

Visual Detection of Polyline Joins As with many perceptual phenomena, there appears to be a threshold effect for detection of a join between polylines. When the change direction, θ, of the polylines is small (e.g. < 3 ), no join is detected and the transition from one segment to the next is seen as smooth. θ

Drawing Visually Smooth Polylines To draw a polyline approximation to a curve that is visually smooth: Choose points along the curve so that the change of angle from segment to segment is less than the visually smooth threshold. Draw the polyline that joins the points.

Mathematical Formulation Given a smooth function f : [a,b] R, let φ(x) be the angle that the tangent to f (x) at x makes with the x-axis. We want to choose a = x 0 < x 1 < x 2 < < x n = b so that the change of angle from x i to x i+1 is small. I.e., for some suitably small δ the x i should satisfy φ(x i+1 ) φ(x i ) < δ for i = 1,...,n. How can the x i values be chosen to make this happen?

A Solution The function h(x) = x a φ (t) dt. is a monotonically non-decreasing function of x and so has a well-defined inverse. Further, if u < v, v φ(v) φ(u) = φ v (t)dt φ (t) dt = h(v) h(u) u u Choose points h(a) = y 0 < y 1 < y 2 < < y n = h(b) such that y i+1 y i < δ for all i. Set x i = h 1 (y i ) then the points ( x0, f (x 0 ) ), ( x 1, f (x 2 ) ),..., ( x n, f (x n ) ) define the approximating polyline.

Choice of Plotting Ordinates h(x) x

A Smooth Polyline Approximation (86 Points)

Computer Implementation To implement the method in a computer the continuous problem is approximated by its discrete version using a very finely spaced grid of points splitting up the interval from a to b. Derivatives are replaced by differences. Indefinite integrals are replaced by cumulative sums. Linear interpolation can be used to compute h(x) and h 1 (u).

An R Implementation smoothx = function(f, a, b, delta = 2.5, n = 1001) { dr = delta * pi / 180 x = seq(a, b, length = n) y = f(x) <Compute scalings ax and ay> phi = atan2(ay * diff(y), ax * diff(x)) d.phi = c(0, diff(phi), 0) u = cumsum(abs(d.phi) + 1e-3/n) if (u[n] - u[1] < dr) x[c(1, length(x))] else approx(u, x, n = ceiling((u[n] - u[1])/dr) + 1)$y }

Piecewise Continuous Functions There are many (useful/interesting) functions that not continuous on their domain or which lie partly outside the plotting window of interest. Extending the drawing method outlined previously requires decomposing the domain of a function into intervals where the smooth polyline approximation can be used. This means dealing with: Regions where the function is out of the viewing window (clipping). Points where the function is not defined. Simple function discontinuities. Asymptotes.

Houston, We Have a Problem Patent No.: US 6,704,013 B2 Michael E. Hosea, 2004 (Texas Instruments) FUNCTION GRAPHING METHOD WITH DETECTION OF DISCONTINUITIES Patent No.: US 7,595,801 B1 Barry M. Cherkas, 2009 COMPLETE FUNCTION GRAPHING SYSTEM AND METHOD Patent No.: US 7,920,142 B2 Luke Kelly and Jinsong Yu, 2009 (Microsoft) IDENTIFYING ASYMPTOTES IN APPROXIMATED CURVES AND SURFACES. These (software) patents make work in this area problematic.

Example: A Discontinuous Function 2 1 0 1 2-1 1/2 0 1/2 1

Example: A Density From Ash s Basic Probability Theory 0.5 0.4 0.3 0.2 0.1 0.0 1 0 1 2 3

Example: The Gamma Function (A Torture Test) 6 4 2 0 2 4 6 4 2 0 2 4

Example: An Empirical CDF 1 1/2 0 0 1/2 1

Example: An Empirical CDF 1 1/2 0 0 1/2 1

Curves and Area Fills 2 1 0 1 2-1 1/2 0 1/2 1

Summary Keeping the constraints and capabilities of human perception in mind can help with the production of software for drawing information (and other) graphics. Two examples were presented. Choosing colours for area fills. Drawing smooth curves.