Display Lists in R. Paul Murrell and Ross Ihaka. February The University of Auckland

Similar documents
Part 1: Introduction to computer graphics 1. Describe Each of the following: a. Computer Graphics. b. Computer Graphics API. c. CG s can be used in

Computer Graphics: Overview of Graphics Systems

Associate Degree for Transfer. Logo Guidelines. February 2017

Part 1: Introduction to Computer Graphics

Comp 410/510. Computer Graphics Spring Introduction to Graphics Systems

Sequence number techniques

CS2401-COMPUTER GRAPHICS QUESTION BANK

EE 350. Continuous-Time Linear Systems. Recitation 2. 1

Appendix 01: Logo Usage. Brand Identity Guidelines 2015

MODFLOW - Grid Approach

v. 8.0 GMS 8.0 Tutorial MODFLOW Grid Approach Build a MODFLOW model on a 3D grid Prerequisite Tutorials None Time minutes

E X P E R I M E N T 1

* This configuration has been updated to a 64K memory with a 32K-32K logical core split.

Lab P-6: Synthesis of Sinusoidal Signals A Music Illusion. A k cos.! k t C k / (1)

Peace4Youth Brand Guidelines

SIDRA INTERSECTION 8.0 UPDATE HISTORY

Computer Graphics. Introduction

Preface 11 Key Concept 1: Know your machine from a programmer s viewpoint 17

Computer Graphics Hardware

Types of CRT Display Devices. DVST-Direct View Storage Tube

Chapt er 3 Data Representation

2.2. VIDEO DISPLAY DEVICES

Bart vs. Lisa vs. Fractions

Screen Shot User Guide Clinical Agency

GS Bloch Equations Simulator 1. GS Introduction to Medical Physics IV Exercise 1: Discrete Subjects

Overview of Graphics Systems

A microcomputer system for color video picture processing

LOGO GUIDELINES. A guide for partners

Objectives: Topics covered: Basic terminology Important Definitions Display Processor Raster and Vector Graphics Coordinate Systems Graphics Standards

Table of content. Table of content Introduction Concepts Hardware setup...4

Case study: how to create a 3D potential scan Nyquist plot?

What s New in Finale An expanded look at some of the new features in Finale 2012

ECE438 - Laboratory 1: Discrete and Continuous-Time Signals

Cancer in females. Visual Display of (Public Health) Data - Theory and Practice. Michael C. Samuel, Dr. P.H. Senior Epidemiologist / Data Scientist

GS122-2L. About the speakers:

Session 1 Introduction to Data Acquisition and Real-Time Control

ILDA Image Data Transfer Format

EndNote Class Outline Using EndNote in Microsoft Word 2007

CORPORATE VISUAL IDENTITY GUIDELINES. for the use of the OAAS Logo

Corporate Logo usage guidelines

USING MATLAB CODE FOR RADAR SIGNAL PROCESSING. EEC 134B Winter 2016 Amanda Williams Team Hertz

Coherence Measurement between two Signals regarding Timing, Phase and Gain Application Note

Linkage 3.6. User s Guide

CALGARY BOARD OF EDUCATION LOGO GRAPHIC STANDARDS GUIDE

Table of Contents. 2 Select camera-lens configuration Select camera and lens type Listbox: Select source image... 8

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU. INFINILINE X 120V LED Light DI-120V-INFX60

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU. INFINILINE X 120V LED Light DI-120V-INFX27

For an alphabet, we can make do with just { s, 0, 1 }, in which for typographic simplicity, s stands for the blank space.

Real Time Face Detection System for Safe Television Viewing

Modal Analysis of a Beam (SI Units)

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU. BLAZE 24V LED Tape Light DI-24V-BL35-90**

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU. BLAZE 24V LED Tape Light DI-24V-BL28-90**

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU. FLUID VIEW 24V LED Tape Light DI-24V-FV50-90**

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU. FLUID VIEW 24V LED Tape Light DI-24V-FV24-90**

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU. FLUID VIEW 24V LED Tape Light DI-24V-FV20-90**

High Performance Raster Scan Displays

Lab 5 Linear Predictive Coding

Channel 4 Television End Credits guide for programmes on the Channel 4 portfolio of channels

TOMELLERI ENGINEERING MEASURING SYSTEMS. TUBO Version 7.2 Software Manual rev.0

PTIK UNNES. Lecture 02. Conceptual Model for Computer Graphics and Graphics Hardware Issues

Title: Genre Study Grade: 2 nd grade Subject: Literature Created by: Synda Tindall, Elkhorn Public Schools (Dec. 2006)

PSC300 Operation Manual

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU. BLAZE Basics 100 LED Tape Light - DI-24V-BLBSC1-63-***

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU. BLAZE BASICS LED Tape Light - DI-24V-BLBSC1-30-W***

Friday 17 May 2013 Morning

Pre-processing of revolution speed data in ArtemiS SUITE 1

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU

Logo Guidelines. If you re local or if we have a Sales Rep in your area, call us at We re happy to help!

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU. BLAZE BASICS LED Tape Light - DI-12-BLBSC2-50-W***

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU. BLAZE BASICS LED Tape Light - DI-24-BLBSC2-30-W***

Table of Contents. Stationery 24 Business card 25 Letterhead 26 #10 Envelope. Document Note

Colour Reproduction Performance of JPEG and JPEG2000 Codecs

A Matlab toolbox for. Characterisation Of Recorded Underwater Sound (CHORUS) USER S GUIDE

Problem Weight Score Total 100

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU. Blaze Basics 200 LED Tapelight DI-12V-BLBSC2-27-***

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU. Blaze Basics 200 LED Tapelight DI-12V-BLBSC2-50-***

passport guide user manual

Handout 1 - Introduction to plots in Matlab 7

MODULE 4: Building with Numbers

Torsional vibration analysis in ArtemiS SUITE 1

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU DI-24V-ES30-BK 3000K BLACK.

EE369C: Assignment 1

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU

LM-79 Test Report. Relevant Standards IES LM IES TM CIE Product SKU

Technical Reference: 2012 Fall Time Change Reminder

TV Character Generator

From Fourier Series to Analysis of Non-stationary Signals - X

R 95 SAFE AREAS FOR 16:9 TELEVISION PRODUCTION VERSION 1.1 SOURCE: VIDEO SYSTEMS

MultiSpec Tutorial: Visualizing Growing Degree Day (GDD) Images. In this tutorial, the MultiSpec image processing software will be used to:

B. TECH. VI SEM. I MID TERM EXAMINATION 2018

ILAR Grade 7. September. Reading

The Lincoln TX-2 Input-Output System*

How smart dimming technologies can help to optimise visual impact and power consumption of new HDR TVs

Deep Neural Networks Scanning for patterns (aka convolutional networks) Bhiksha Raj

Package rasterimage. September 10, Index 5. Defines a color palette

ILDA Image Data Transfer Format

Training Note TR-06RD. Schedules. Schedule types

Characterization and improvement of unpatterned wafer defect review on SEMs

Transcription:

Paul Murrell and Ross Ihaka The University of Auckland February 16 2007

What is a Display List? A display list is a record of the graphics commands used to create a drawing. It is not a backing store. windows(bg="cornsilk") dev.control("inhibit") plot(1:10) # Cover/uncover window A graphics command may imply a considerable amount of calculation before drawing occurs, e.g., coordinate system transformations. dev.control("enable") plot(1:10)

What is a Display List for? A display list is required when the drawing needs to be automatically redrawn. To explore aspect ratios. # Resize device To copy between devices with different sizes or different formats (raster versus vector). dev.print()

The Display List in R The graphics commands recorded on the display list in R are C-level entry points for graphics functions. > plot(1:10) > myplot <- recordplot() > lapply(myplot[[1]], "[[", 1).Primitive("plot.new").Primitive("plot.window").Primitive("plot.xy").Primitive("axis").Primitive("axis").Primitive("box").Primitive("title") All calculations in C code are rerun when the display list is rendered.

The Problem with the Display List in R The display list in R is not always up to the job. plot(1:10) legend(1, 10, "An example", pch=1, bg="tan") The problem is that calculations in R code are not recorded on the display list. > lapply(recordplot()[[1]], "[[", 1).Primitive("plot.new").Primitive("plot.window").Primitive("plot.xy").Primitive("axis").Primitive("axis").Primitive("box").Primitive("title").Primitive("rect").Primitive("plot.xy").Primitive("text")

The Problem with the Display List in R The R code consists of... 1 draw plot 2 calculate size and position of legend 3 draw legend... but the display list only records... 1 draw plot 2 draw legend Another way to state the problem is that the system is deciding what to record on the display list and it is not smart enough.

The Solution Paul Murrell and Ross Ihaka The recordgraphics() function records an arbitrary expression on the display list, along with an environment within which to evaluate the expression. recordgraphics(expr, list, env) expr: object of mode expression or call or an "unevaluated expression". list: a list defining the environment in which expr is to be evaluated. env: An environment specifying where R looks for objects not found in envir. In other words, let the user decide what goes on the display list.

The Solution in Action Now calculations in R code can be captured on the display list. plot(1:10) recordgraphics(legend(1, 10, "An example", pch=1, bg="tan"), list(), globalenv()) > lapply(recordplot()[[1]], "[[", 1).Primitive("plot.new").Primitive("plot.window").Primitive("plot.xy").Primitive("axis").Primitive("axis").Primitive("box").Primitive("title").Primitive("recordGraphics")

The Solution in Action Now calculations in R code can be captured on the display list. > recordplot()[[1]][[8]] [[1]].Primitive("recordGraphics") [[2]] [[2]][[1]] legend(1, 10, "An example", pch = 1) [[2]][[2]] list() [[2]][[3]] <environment: R_GlobalEnv>

The Solution in Action It is possible to make, for example, the arrangement of plots much smarter. windows(bg="cornsilk") source("dynamic.r") grid.dynamic()

The Solution in Action A little more expertise is required to operate this mechanism correctly and/or efficiently. Some approaches are more efficient than others. plot(1:10) recordgraphics(legend(1, 10, "An example", pch=1), list(), getnamespace("graphics")) It is not hard to get it wrong. plot(1:10) recordgraphics(legend(1, 10, "An example", pch=1), list(), emptyenv())

The Problem with the Solution The system is smart enough to avoid obvious problems... recordgraphics(recordgraphics(plot(1:10), list(), getnamespace("graphics")) list(), getnamespace("graphics")) recordplot()[[1]]... but it is not a good idea to put actions with global side-effects on the display list. recordgraphics({ plot(1:10); windows() }, list(), getnamespace("graphics"))

Conclusions Paul Murrell and Ross Ihaka The original display list in R gave the system too much control. The recordgraphics() function gives the user too much power. There is NOT a happy middle ground.

The other Display List in R the answer to Martin s question The grid graphics system also maintains a display list. Whenever a grid function, e.g., grid.circle(), is called, the following happens: 1 A graphical object (grob) is created. 2 A call to the drawgrob() function is recorded on R s display list. 3 The grob itself is stored on grid s display list. grid.circle() recordplot()[[1]] getnames()

The other Display List in R The drawgrob() function calls an appropriate drawdetails() method for the grob, so any code in a drawdetails() method will be rerun when R s display list is rendered. grid.dynamic dynamicgrob body(drawdetails.dynamic) Do NOT put a grid function inside a recordgraphics() call. recordgraphics(grid.circle(), list(), globalenv()) recordplot()[[1]] getnames()

What is the grid Display List for? R s display list is only designed for rerunning code. Grid s display list is designed for several things: Modifying the drawing (including removing elements). Querying the drawing, e.g., determine where drawing has occurred.