Chapter 8

Developing New Graphics Functions and Objects

Chapter preview

This chapter looks in depth at the task of writing graphical functions for others to use.

There are important guidelines for writing simple functions whose main purpose is to produce graphical output. There is an emphasis on making sure that other users can annotate the output produced by a function and that other users can make use of the function as a component in larger or more complex plots.

There is also a discussion on how to create a new class of graphical object. This is important for allowing users to interactively edit output, to ask questions such as how much space a graphical object requires, and to be able to combine graphical objects together in a gTree.

Get R Graphics, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.