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.

Slides:



Advertisements
Similar presentations
Chapter 3 – Web Design Tables & Page Layout
Advertisements

Plotting Selim Aksoy Bilkent University Department of Computer Engineering
Lecture (4) Plotting & Programming (1) Eng. Osama Talaat 1.
® Microsoft Office 2010 Excel Tutorial 4: Enhancing a Workbook with Charts and Graphs.
CREATING A MULTIPLE PAGE REPORT Presented by: Dr. Ennis-Cole.
PowerPoint. Getting Started with PowerPoint Objectives Start PowerPoint and open presentations Explore toolbars and menus Use the Office Assistant Work.
MATLAB’s extensive, device-independent plotting capabilities are one of its most powerful features. They make it very easy to plot any data at any time.
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.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Excel 2003 Lab 2 Charting Worksheet Data.
Graphics in MATLAB Week 15 – 5/5/09 Kate Musgrave
EGR106 Week 6 MATLAB FILES Two Dimensional Plots Multiple Plots
MATLAB Week 3 17 November Outline Graphics – Basic plotting – Editing plots from GUI – Editing plots from m-file – Advanced plotting commands.
Statistics and Simple Plots. Outline Announcements: –Homework II: due Wed. by 5, by Cookie Challenge Statistics Simple plots Tutorial 4.
1 Computing for Todays Lecture 10 Yumei Huo Fall 2006.
Lecture 9 Plotting in 2-D Plotting in 2-D, Plotting Multiple Curves, Plotting with Figures, Plot Settings, Scaling, Legends © 2007 Daniel Valentine. All.
Using Charts in a Presentation Lesson 6. Software Orientation Charts can help your audience understand relationships among numerical values. The figure.
XP New Perspectives on Microsoft Office Excel 2003 Tutorial 4 1 Microsoft Office Excel 2003 Tutorial 4 – Working With Charts and Graphics.
Chapter 5 Using Business Information Sets
An introduction to Plotting in MATLAB Rikard Johansson Department of Biomedical Engineering (IMT) Linköping University
WORKING WITH CHARTS. OBJECTIVES  Plan a chart  Create a chart  Move and resize a chart  Change the chart design  Change the chart layout  Format.
 Insert a picture from a file  Move and delete images  Use the Picture Tools tab  Add styles, effects, and captions to images  Resize photos  Use.
Chapter 5 Review: Plotting Introduction to MATLAB 7 Engineering 161.
Tutorial 4: Using CSS for Page Layout. 2 Objectives Session 4.1 Explore CSS layout Compare types of floating layouts Examine code for CSS layouts View.
Basic PowerPoint Skills. What is a Presentation? Presentation: an informative speech that usually includes visuals, such as slides. The file name for.
PLOTS AND FIGURES DAVID COOPER SUMMER Plots One of the primary uses for MATLAB is to be able to create publication quality figures from you data.
ENG College of Engineering Engineering Education Innovation Center 1 2D Plots 1 in MATLAB Topics Covered: 1.Plotting basic 2-D plots The plot()
Return to the Excel 2007 web page Lesson 6: Discovering the Magic of Excel Charting.
1 "A picture is worth a thousand words." Graphical representation is useful for: Error detection - you can locate outliers in a dataset, program bugs,
Matlab tutorial course Lesson 5: Loading and writing data, producing visual output
Ranjeet Department of Physics & Astrophysics University of Delhi Working with Origin.
XP 1 Microsoft Word 2002 Tutorial 1 – Creating a Document.
Microsoft ® Office Excel 2007 Working with Charts.
MATLAB and SimulinkLecture 51 To days Outline Linear Equations ODE Integration Handle Graphics. Exercises on this days topics.
Graphing Exercise. In this exercise you are going to make as many dots as you can on your whiteboard in a chosen amount of time. You will then graph your.
Statistics and Simple Plots. Outline Announcements: –Homework II: due Today. by 5, by Statistics Simple plots.
SUNY-New Paltz Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz “Lecture 9”
Outline Announcements –Homework I due Wed. 5PM by Subject: CIS 402 Homework 1 Plain text Not allowed to use errorbar Try to do plotCI without looking.
CREATING CHARTS By: Dr. Ennis - Cole OBJECTIVES b Identify the elements of an Excel chart b Identify the type of chart represents your data most effectively.
Return to Outline Copyright © 2011 by Maribeth H. Price 3-1 Labeling and annotation.
Barak Shenhav Early Evolution Course 11 Feb 2001 MATLAB Visualization, Functions & Debugging.
Matlab Screen  Command Window  type commands  Current Directory  View folders and m-files  Workspace  View program variables  Double click on a.
Figures & Axes, Printing & Saving. Outline Announcements –Homework I due Wed. 5PM by –No lecture on Fri. 10/26, rescheduled to Wed. 10/31 at 8AM.
GUI development with Matlab: GUI Front Panel Components GUI development with Matlab: Other GUI Components 1 Other GUI components In this section, we will.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
Recap Chapter 5 “Plotting” Two Dimensional Plots Simple x-y Plots Titles, Labels and Grids Multiple Plots.
EGR 106 Lecture 6 2-D Plotting Graphical presentation has become the standard method to show technical information. Engineers use plots to analyze, visualize,
The desktop (overview) Working with desktop icons The desktop is the main screen area that you see after you turn on your computer and log on to Windows.
Introduction to Drafting and Design In order to begin our drawing we have to set the drawing limits or the paper size.
GRAPHICS AND VISUALISATION WITH MATLAB UNIVERSITY OF SHEFFIELD CiCS DEPARTMENT Deniz Savas & Mike Griffiths May 2015.
Handle Graphics and 1D Primitives Some Handel graphics.
Introduction to Engineering MATLAB – 9 Plotting - 2 Agenda Formatting plots.
Microsoft FrontPage 2003 Illustrated Complete Creating a Frames Page.
MATLAB ® for Engineers, Holly Moore Fourth Edition, Global Edition © Pearson Education Limited 2015 All rights reserved. Figure 5.1 Simple Plot of Time.
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.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Lab 2 : potting to Matlab Networks.
Word and the Writing Process. To create a document 1.On the Start menu, point to Programs, and then click Microsoft Word. A new document opens in Normal.
Graphics Intro UC Berkeley Fall 2007, E7 Copyright , Andy Packard and Roberto Horowitz. This work is licensed under the Creative Commons Attribution-ShareAlike.
EGR 106 – Week 5 – 2-D Plots Question : Why do engineers use plots? Answer : To analyze, visualize, and present data. Matlab has many useful plotting options.
Chapter 2 – Quick Start. Create a new drawing Saving your work Switch between Layout Space and Model Space Draw some basic AutoCAD objects Toggle the.
Practical Office 2007 Chapter 2
Creating a Plot The plot function can take one or more inputs; e.g. plot (x, y) or plot (y) Note that in the two-argument version, the vectors x and.
Microsoft Access 2007 – Level 2
3D-Graphs A 3D surface is defined as: z = f(x, y)
Ch3 Graphics Overview of Plotting Editing Plots
Lecture 25: Exploring data
Tutorial 1 – Creating a Document
MatLab – Palm Chapter 5 2-D & 3-D Plots
Otasuke GP-EX! Chapter 1 Menu Screen.
Plotting Signals in MATLAB
Designing Effective Graphics Using MATLAB
Presentation transcript:

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 Figures Axes Printing and saving

HWI Programming problem: add confidence intervals: –H=plotCI(x,y,CI)

Cookie Challenge Your function must return handles to any objects it creates –Handle(s) to dots at x,y –Handle(s) to CI lines Fairly easy to create each CI line as a unique object (20 handles for example) But, I think it is possible to create CI lines as a single object (1 handle) –Anyone who figures out 1-handle problem will win a cookie Ties will be decided by programming style –Comments, error checking, elegance, speed

colortime Example on plot/colortime on web site Colortime shows time (or any 3rd dimension) using color

What happens when you plot We know that plot(x,y) produces a line object We also know that we can get a handle to the object and change its properties But, other things happen too: –A new window is created (a “figure”) –A white rectangle is placed in the window (an “axes”) –The rectangle has ticks and numbers attached to it –The line object is placed on the rectangle

Figures and Axes Figures and axes are also objects We can get handles to them and change their properties These objects are created as needed when graphics routines are called –They can also be created explicitly

Figures If no figures are open, Matlab will create one when you call a graphics routine If a figure is open, then any subsequent graphics will be placed in that figure Figures can be created explicitly by calling figure –h=figure; --creates a new figure, handle saved in h Figures can be cleared with clf

Multiple Figures If multiple figures are open and you call plot, where does the new line go? –One of the figures is the “current figure” the current figure is the last one you plotted into or the last one created the function gcf returns a handle to the current figure

More ways to use figure –figure(n) if figure number n doesn’t exist, then it is created if it exists, then it becomes the current figure regardless, it will be the current figure –figure(h)--changes current figure to h (a figure handle) Delete figures with close –close(h)--closes figure with handle h –close(n)--closes figure number n –close all closes all figures Multiple Figures

Figure Properties Lots of properties, the interesting ones are –color--color of figure (usually gray) –colormap--specifies colors for 2D plots –Paper stuff--controls how figure maps onto printer page

–Position--[llx,lly,width, height] (llx,lly) is the position of the lower-left corner –Renderer-- ‘painters’, ‘zbuffer’, ‘OpenGL’ algorithms used to display the graphics –Units-- ‘pixels’ or ‘relative’ --units used to specify position Figure Properties

Axes Figures can only contain axes (and some special GUI stuff) Axes can contain anything (except figures, axes, and some GUI stuff) Axes are created if needed Can be created explicitly with axes –axes -- creates default axes (most of figure) –axes(‘position’,[llx,lly,width, height])--creates axes with specific position –can return handle to the new axes

Multiple Axes If several axes exist on gcf, where does your plot go? –One of the axes is the “current axes” The current axes is the last one you plotted into or the last one created The function gca returns a handle to the current axes Switching gcf will switch gca

Multiple Axes In many ways, axes and figures are managed the same way, but… –axes are not numbered in any intelligible way, so axes(1) is meaningless –If you have multiple axes, you must save their handles and switch axes using axes(h) –Matlab’s subplot command returns some of this functionality (example in a minute)

Axes Properties Box--on/off --switches box around axes on and off Camera stuff--controls how the objects in axes are viewed Clim--limits for color mapping Color--color of the axes (usually white) Font stuff--controls fonts on labels Line stuff--properties of the axes lines (options for grid lines)

NextPlot-- ‘add’, ‘replace’, ‘replacechildren’-- what happens to objects in axes when a new one is created –default is replace--old stuff is deleted –can change to add using “hold on” or replace using “hold off” Position--controls where the axes goes in figure Tick stuff--controls properties of tick marks Title--handle of text object with axes title –title(‘axes title’) will title the axes Units--several options, default is normalized Axes Properties

Axes have 3 axes: X (horizontal), Y (vertical), Z (height) We can control the range and appearance of each –XColor--color of the axis lines –XGrid--on/off turns grid lines on or off –XLabel--handle of text object with x axis label xlabel(‘x label’) will label the x axis –XLim--range of the x axis cas set xlim and ylim togther with axis command –XScale--linear/log --can plot on a log10 scale

–Xtick--where the tick marks (and labels) occur –XTickLabel--the labels Matlab works hard to pick “good” labels (base 10) Can change labels by setting ticklabel –set(gca, ‘xticklabel’, ‘first|second|third’) –Setting Xtick or XTickLabel will change XTickMode or XLabelModes to ‘manual’-- may give problems if figure is resized Axes Properties

Handle Tree Matlab organizes graphics like a tree The parent and children fields allow you to traverse the tree FIGURE GUIAXES TEXTLINE get(gca,’parent’) gca get(gca,’children’)

Example--subplot vs. multiax You can produce mulitple axes laid out in a regular fashion using subplot –subplot(m,n,j) produces the jth axes from an m-by-n grid of axes –if subplot(m,n,j) exists, then calling it will set gca to this axes –h=subplot(m,n,j) returns the handle to the jth subplot subplot(3,2,4)

Criticisms of subplot Numbering is consistent with English, but not with Matlab Too much white space--gets ugly if m or n are big [fax,ax]=multiax(m,n,{limits}) is a “flexible, hands-on” alternative to subplot –Fax=handle to invisible axes encompassing whole figure useful for annotating figure –ax=m-by-n matrix of handles to the m*n subplots numbered “correctly” –limits allows you to control space around axes 1 (1,1)4 (1,2) 2 (2,1)5 (2,2) 3 (3,1)6 (3,2)

Printing and Saving Print through GUI or command line –print -depsc fname.eps will save gcf to an EPS file –print -djpeg fname.jpg will save gcf to a JPEG –Can also save figure to a.fig file from the GUI Opening the file (from GUI) will recreate the figure