Customizing Graphs Base graphics options. plot() The workhorse plotting function plot(x) plots values of x in sequence or a barplot plot(x, y) produces.

Slides:



Advertisements
Similar presentations
Introduction to R Graphics
Advertisements

Graphics in R data analysis and visualization Katia Oleinik Scientific Computing and Visualization Boston University
Computer Information Technology – Section 4-3 Some text and examples used with permission from:
Fundamental Features of Graphs All graphs have two, clearly-labeled axes that are drawn at a right angle. –The horizontal axis is the abscissa, or X-axis.
FIRST COURSE Excel Tutorial 4 Working with Charts and Graphics.
Evan Girvetz Winkenwerder Introduction to Graphics in R © R Foundation, from
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Word 2003 Lab 3 Creating Reports and Tables.
COMPREHENSIVE Excel Tutorial 4 Working with Charts and Graphics.
Obj Understand charts and graphs used in business.
Lecture 9 Plotting in 2-D Plotting in 2-D, Plotting Multiple Curves, Plotting with Figures, Plot Settings, Scaling, Legends © 2007 Daniel Valentine. All.
XP New Perspectives on Microsoft Office Excel 2003 Tutorial 4 1 Microsoft Office Excel 2003 Tutorial 4 – Working With Charts and Graphics.
Graphing with Excel: Graphing Made Easy Mac 2008 Version.
Baburao Kamble (Ph.D) University of Nebraska-Lincoln Data Analysis Using R Week5: Charts/Plots in R.
Excel Lesson 10 Using Advanced Chart Features Microsoft Office 2010 Advanced Cable / Morrison 1.
Designing Effective Graphics Using MATLAB The Cain Project in Engineering and Professional Communication ENGINEERING SERIES.
An Introduction to R graphics Elizabeth Garrett-Mayer Slides borrowed from Cody Chiuzan & Delia Voronca March 24, 2014.
AN INTRODUCTION TO GRAPHICS IN R. Today Overview Overview –Gallery of R Graph examples High-Level Plotting Functions High-Level Plotting Functions Low-Level.
Graphics in R. X
R Graphics Lori Shepherd-Kirchgraber May 22, 2012.
ENG College of Engineering Engineering Education Innovation Center 1 2D Plots 1 in MATLAB Topics Covered: 1.Plotting basic 2-D plots The plot()
Graphs in Science You Can Do It!!!.
R-Graphics Day 2 Stephen Opiyo. Basic Graphs One of the main reasons data analysts turn to R is for its strong graphic capabilities. R generates publication-ready.
Creating Graphs in R Graphing techniques Sharon style! (I am not sure if this is a good or bad thing but this is what I do...)
Ranjeet Department of Physics & Astrophysics University of Delhi Working with Origin.
Chapter 9 Creating and Designing Graphs. Creating a Graph A graph is a diagram of data that shows relationship among a set of numbers. Data can be represented.
Microsoft Office Illustrated Introductory, Premium Edition with Charts Working.
Graphing Parameters Titles X-Axis Title Y-Axis Title Legend Scales Color Gridlines library(help="graphics") Basic Chart Types The R Graphics Package LineHistogram.
An Introduction to R graphics Cody Chiuzan Division of Biostatistics and Epidemiology Computing for Research I, 2012.
Microsoft ® Office Excel 2007 Working with Charts.
CSCE 121: Introduction to Program Design and Concepts Dr. J. Michael Moore Spring 2015 Set 12: A Display Model 1 Based on slides created by Bjarne.
Copyright 2006 South-Western/Thomson Learning Chapter 12 Tables.
Copyright © 2006 Mark Logic Corporation. All rights reserved.
Designing Effective Graphics Using MATLAB The Cain Project in Engineering and Professional Communication Linda Driskill, Gang Cheng,
Learn R Toolkit D Kelly O'DayBox, Dot, Histogram, Strip Charts Mod 5 –Box Charts: 1 Module 5 Box, Dot, Histogram, Strip Charts Do See & HearRead Learn.
Session 9 Managerial Spreadsheet Modeling -- Prof. Juran1.
ENG 1181 College of Engineering Engineering Education Innovation Center MATLAB – 2D Plots 1 Go to the class drive: ---> MatLab - Graphing ---> Seed Files.
Copyright © 2008 Pearson Prentice Hall. All rights reserved Committed to Shaping the Next Generation of IT Experts. Chapter 5 Charts and Graphs Robert.
Bar Graphs Used for comparing separate groups. Axes X- axis: independent variable (what the scientist controls) Horizontal D – dependent R – responding.
DAY 6: MICROSOFT EXCEL – CHAPTER 3 Sravanthi Lakkimsetty September 2, 2015.
R-Graphics Stephen Opiyo. Basic Graphs One of the main reasons data analysts turn to R is for its strong graphic capabilities. R generates publication-ready.
PROC GPLOT GPLOT is used to make two dimensional scatter-plots. General Syntax: proc gplot data=data-set options; plot y-variable*x-variable/options; run;
EGR 106 Lecture 6 2-D Plotting Graphical presentation has become the standard method to show technical information. Engineers use plots to analyze, visualize,
R (3) Introduction to Graphics. The main guide R in Action Data Analysis and Graphics with R Robert I. Kabacoff
Data Display and Cartography Chapter 8 – Chang Week 5.
Plotting Complex Figures Using R
Chapter 15: Spreadsheet and Worksheet Basics Lesson 96: Worksheets with Charts © 2010, 2006 South-Western, Cengage Learning.
ElVis Improvements Summer 2008 Eric Zatz PPPL Summer Intern Mentor – Eliot Feibush August 11, 2008.
INDESIGN TO REVIEW. TEXT TOOL Used to -change font and font size -add text to text blocks -selecting and highlighting text.
CHART COMPONENTS Lesson 6 – Working With Charts and Graphics, continued.
Lattice- xyplot Yufeng Lin Haipeng Yao. How to use xyplot Xyplot(formula, data = parent.frame(), panel = if (is.null(groups)) "panel.xyplot" else "panel.superpose",
Introduction to Engineering MATLAB – 9 Plotting - 2 Agenda Formatting plots.
DESKTOP PUBLISHING. Publishing The process of presenting material in printed form.
Excel Part 4 Working with Charts and Graphics. XP Objectives Create an embedded chart Work with chart titles and legends Create and format a pie chart.
Figures & Axes, Printing & Saving. Outline Announcements –Homework I on web, due Wed. 5PM by –No lecture on Fri. 10/26, rescheduled to Wed. 10/31.
1 HTML. 2 Full forms WWW – world Wide Web HTTP – Hyper Text Transfer Protocol HTML – Hyper Text Markup Language.
Introduction to plotting data Fish 552: Lecture 4.
CHART COMPONENTS Lesson 6 – Working With Charts and Graphics, continued.
Figures & Axes, Printing & Saving. Outline Announcements –Homework I on web, due Wed. 5PM by e- mail A word on HWI and cookies What happens when you plot.
Review > mean(humidity, na.rm=T) > humidity[!is.na(humidity)] > X x Y Y[[1]][2,3] > zone.fac
CHART COMPONENTS Excel. COMPONENTS OF CHARTS AND GRAPHS ▪ The y-axis is the left vertical side of the graph. It contains the numerical data. ▪ The x-axis.
Permeability (% of Control)
Using R Graphs in R.
Trevor A. Branch FISH 552 Introduction to R
8.04 Spreadsheet Charts 8.04 Spreadsheet Charts.
PowerPoint Guidelines
Microsoft Office Illustrated Introductory, Windows XP Edition
CSc4730/6730 Scientific Visualization
Introduction to R plot Instructor: Li, Han
Use a Large Bold Type for the Main Title (80 pt):
Use a Large Bold Type for the Main Title (70 pt):
Presentation transcript:

Customizing Graphs Base graphics options

plot() The workhorse plotting function plot(x) plots values of x in sequence or a barplot plot(x, y) produces a scatterplot plot(y~x, data=data.frame) produces a scatterplot Many statistical functions produce results that can be plotted using plot

Variations on plot() type = “p”, “l”, “b”, or “n” for points, lines, both, or no plot (also “c”, “o”, “h”, “s”, “S”) asp = sets the y/x aspect ratio (asp=1 for mapping) Full control over labels, axes, symbols, lines, etc

Parameter cex= cex controls the size of text and symbols in a graph cex = 1 is the default size (except for main= where it is 2) cex.main, cex.sub, cex.lab, cex.axis control specific parts of the plot cex = alone usually controls the size of pch, the plot character

Symbol/Line Styles pch = (plot character) specifies the symbol set cex = symbol size lty = specifies the line type lwd = specifies the line thickness

Parameter col= col = controls the color of a symbol or line col.axis, col.lab, col.main, col.sub control colors of other parts of the graph bg = background color col takes a name or hexadecimal color value

Color colors() for list of 657 named colors palette() gives the default list of eight colors gray() gives grayscale from black - gray(0) to white – gray(1)

Color Palettes rainbow(number) generates a spectrum from red to violet based on hue, saturation, and value (hsv) rainbow_hcl(number) similar, but using hue, chroma, and luminance color space (hcl) Help pages for these give several other palettes

Fonts family = sets the font family – “serif”, “sans”, and “mono” – others may be defined by specific graphic devices font = sets the font, 1 plain, 2 bold, 3 italic, 4 bold italic, 5 symbol Fonts may be device dependent

Labels main = “This is the title”, cex.main, col.main, font.main sub = “This is the subtitle”, cex.sub, col.sub, font.sub Axis labels –lab = “This is the x-axis label” –ylab = “This is the y-axis label” –cex.lab, col.lab, font.lab, las (0, 1, 2, 3)

Axes Default usually selects reasonable axes xlim, ylim set limits for axes xaxp, yaxp set tick marks xlog, ylog to use log scale xaxt, yaxt “n” suppresses plotting

axis() Use to add a customized axis or position an axis on the top or right of the plot or in the margin of the plot at = specifies location of tickmarks labels = specifies labels

Adding to a Graph 1 Plot sets up coordinates grid – add gridlines abline – add regression, vertical, or horizontal lines (full plot window) points – add points lines – add lines segment – add line segments

Adding to a Graph 2 text – add text to plot legend (locator, position, coords) arrows – draw arrows rect – draw rectangles polygon – draw polygons ellipse – draw probability ellipse matlines – draw multiple lines

Margins Must be set before calling plot oldpar <- par() # to save current par(mar= c(bottom, left, top, right)) if you need more space for labels, titles, etc

Multiple Graphs par(mfrow=c(rows, cols)) plots in rows Par(mfcol=c(rows, cols)) plots in columns