Ch3 Graphics Overview of Plotting Editing Plots

Slides:



Advertisements
Similar presentations
Working with Tables for Page Design – Lesson 41 Working with Tables for Page Design Lesson 4.
Advertisements

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.
Microsoft Excel 2010 Chapter 7
MATLAB GRAPHICS 2-D.
Automating Tasks With Macros
MATLAB Week 3 17 November Outline Graphics – Basic plotting – Editing plots from GUI – Editing plots from m-file – Advanced plotting commands.
Introduction to Matlab Jianguo Wang CSSCR September 2009.
WORKING WITH CHARTS. OBJECTIVES  Plan a chart  Create a chart  Move and resize a chart  Change the chart design  Change the chart layout  Format.
Chapter 5 Review: Plotting Introduction to MATLAB 7 Engineering 161.
Word Processing ADE100- Computer Literacy Lecture 12.
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.
C51BR Applications of Spreadsheets 1 Chapter 16 Getting Started Making Charts.
CMPS 1371 Introduction to Computing for Engineers PLOTTING.
MATLAB Plotting With MATLAB 1. Two Dimensional Plots The xy plot is the most commonly used plot by engineers The independent variable is usually called.
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.
INTRODUCTION TO MATLAB LAB# 01
MA/CS 3751 Fall 2002 Lecture 24. MA/CS 3752 ginput ginput is a Matlab function which takes one argument input: number of points to select in the image.
Matlab Programming for Engineers Dr. Bashir NOURI Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
© 2011 Delmar, Cengage Learning Chapter 1 Getting to Know Illustrator.
Macromedia Studio 8 Step-by-Step MACROMEDIA FIREWORKS 8 Project 2: Experience Bank Logo.
Laboratory Exercise # 9 – Inserting Graphics to Documents Office Productivity Tools 1 Laboratory Exercise # 9 Inserting Graphics to Documents Objectives:
Matlab 14.html Cost: $100 Available in labs on Windows and Unix machines.
Introduction MATLAB stands for MATrix LABoratory.  Basics  Matrix Manipulations  MATLAB Programming  Graphics  Image types  Image Processing  Useful.
1. Chapter 15 Creating Charts 3 Charting Data in Word A chart or graph presents data visually. A chart depicts numeric data in a graphical format. If.
Lesson 7 – Working with Graphics Microsoft Word 2010.
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.
Recap Chapter 5 “Plotting” Two Dimensional Plots Simple x-y Plots Titles, Labels and Grids Multiple Plots.
Recap Plots with More than one Line Plots of Complex Arrays Line, Color and Mark Style Axis Scaling and Annotating Plots Subplots Polar Plots Logarithmic.
Lesson 10 Word Processing Unit 2—Using the Computer.
ELG 3120 Lab 2 TAs Wei Zhang Ozgur Ekici (Section A) (Section B)
GRAPHICS AND VISUALISATION WITH MATLAB UNIVERSITY OF SHEFFIELD CiCS DEPARTMENT Deniz Savas & Mike Griffiths May 2015.
MATLAB ® for Engineers, Holly Moore Fourth Edition, Global Edition © Pearson Education Limited 2015 All rights reserved. Figure 5.1 Simple Plot of Time.
EEE 242 Computer Tools for Electrical Engineering
Creating a Presentation
Excel Charts and Graphs
Reading and Writing Image Files
Computer Fundamentals
John Federici NJIT Physics Department
ECE 1304 Introduction to Electrical and Computer Engineering
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 Office PowerPoint 2003
Understand Charts and SmartArt Graphics
Working with Charts © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Introduction to Mat lab
Learning the Basics – Lesson 1
Chapter A - Getting Started with Dreamweaver MX 2004
Plotting Chapter 5.
3D-Graphs A 3D surface is defined as: z = f(x, y)
Lecture 25.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Lecture 25: Exploring data
Creating, Formatting, and Editing a Word Document with Pictures
Microsoft PowerPoint 2003 Illustrated Introductory
MS 2013 POWERPOINT.
Word for Mac 2011 One of the most important skills a working professional possesses is the ability to express ideas, opinions, and research findings in.
MATLAB DENC 2533 ECADD LAB 9.
Chapter 7 Advanced Form Techniques
Tutorial 3 – Creating a Multiple-Page Report
ITEC 1001 Test 5 Review.
MatLab – 2D Plots 2 MATLAB has many built-in functions and commands to create various types of plots. Instructor notes: We start with an example of some.
Plotting Data with MATLAB
Introduction to MATLAB Plotting LAB 3
CSCI N317 Computation for Scientific Applications Unit 1 – 5 MATLAB
Getting Started with Adobe Illustrator CS6
Yang-Ming University, Taipei, Taiwan
Plotting Signals in MATLAB
MATLAB stands for MATrix LABoratory.
Chapter 8 Using Document Collaboration and Integration Tools
Welcome To Microsoft Word 2016
Presentation transcript:

Ch3 Graphics Overview of Plotting Editing Plots Some Ways to Use Plotting Tools Preparing Graphs for Presentation Using Basic Plotting Functions Creating Mesh and Surface Plots Plotting Image Data Printing Graphics Understanding Handle Graphics Object

1. Overview of Plotting Plotting Process Graph Components Figure Tools Arranging Graphs Within a Figure Choosing a Type of Graph to Plot

2. Editing Plots Plot Edit Mode Using Functions to Edit Graphs

Enabling Plot Edit Mode

Setting Object Properties

Using the Property Editor

Using Functions to Edit Graphs If you prefer to work from the MATLAB command line, or if you are creating a MATLAB program file, you can use MATLAB commands to edit the graphs you create. You can use the set and get commands to change the properties of the objects in a graph. For more information about using graphics commands, see Understanding Handle Graphics Objects.

3. Some Ways to Use Plotting Tools Plotting Two Variables with Plotting Tools Changing the Appearance of Lines and Markers Adding More Data to the Graph Changing the Type of Graph Modifying the Graph Data Source

Plotting Two Variables with Plotting Tools x = -1:.1:1; % Define the range of x y = x.^3; % Raise each element in x to the third power

Changing the Appearance of Lines and Markers

4. Preparing Graphs for Presentation Annotating Graphs for Presentation Printing the Graph Exporting the Graph

Annotating Graphs for Presentation x = -10:.005:40; y = [1.5*cos(x)+4*exp(-.01*x).*cos(x)+exp(.07*x).*sin(3*x)]; plot(x,y)

Printing the Graph Before printing the graph, select File > Print Preview to view and modify how the graph will be laid out on the page. When you are ready to print your plot, click Print in the right pane. You can also click Close to accept the settings and dismiss the dialog box. You can print the figure as you previewed it using Print on the figure's File menu.

Exporting the Graph Exporting a graph is the process of creating a standard graphics file format of the graph (such as EPS or TIFF), which you can then import into other applications like word processors, drawing packages, etc. This example exports the graph as an EPS file with the following requirements: The size of the picture when imported into the word processor document should be 4 inches wide and 3 inches high. All the text in the figure should have a size of 8 points.

5. Using Basic Plotting Functions Creating a Plot Plotting Multiple Data Sets in One Graph Specifying Line Styles and Colors Plotting Lines and Markers Graphing Imaginary and Complex Data Adding Plots to an Existing Graph Figure Windows Displaying Multiple Plots in One Figure Controlling the Axes Adding Axis Labels and Titles Saving Figures

Creating a Plot x = 0:pi/100:2*pi; y = sin(x); plot(x,y) xlabel('x = 0:2\pi') ylabel('Sine of x') title('Plot of the Sine Function','FontSize',12)

Plotting Multiple Data Sets in One Graph x = 0:pi/100:2*pi; y = sin(x); y2 = sin(x-.25); y3 = sin(x-.5); plot(x,y,x,y2,x,y3) legend('sin(x)','sin(x-.25)','sin(x-.5)')

Graphing Imaginary and Complex Data t = 0:pi/10:2*pi; plot(exp(i*t),'-o') axis equal

Adding Plots to an Existing Graph [x,y,z] = peaks; pcolor(x,y,z) shading interp hold on contour(x,y,z,20,'k') hold off

Displaying Multiple Plots in One Figure The subplot command enables you to display multiple plots in the same window or print them on the same piece of paper. Typing subplot(m,n,p) t = 0:pi/10:2*pi; [X,Y,Z] = cylinder(4*cos(t)); subplot(2,2,1); mesh(X) subplot(2,2,2); mesh(Y) subplot(2,2,3); mesh(Z) subplot(2,2,4); mesh(X,Y,Z

6. Creating Mesh and Surface Plots About Mesh and Surface Plots Visualizing Functions of Two Variables

About Mesh and Surface Plots Visualizing Functions of Two Variables To display a function of two variables, z = f (x,y), Generate X and Y matrices consisting of repeated rows and columns, respectively, over the domain of the function. Use X and Y to evaluate and graph the function. The meshgrid function transforms the domain specified by a single vector or two vectors x and y into matrices X and Y for use in evaluating functions of two variables. The rows of X are copies of the vector x and the columns of Y are copies of the vector y.

Example — Graphing the sinc Function This example evaluates and graphs the two-dimensional sinc function, sin(r)/r, between the x and y directions. R is the distance from the origin, which is at the center of the matrix. Adding eps (a MATLAB command that returns a small floating-point number) avoids the indeterminate 0/0 at the origin: [X,Y] = meshgrid(-8:.5:8); R = sqrt(X.^2 + Y.^2) + eps; Z = sin(R)./R; mesh(X,Y,Z,'EdgeColor','black')

Example — Colored Surface Plots A surface plot is similar to a mesh plot except that the rectangular faces of the surface are colored. The color of each face is determined by the values of Z and the colormap (a colormap is an ordered list of colors). These statements graph the sinc function as a surface plot, specify a colormap, and add a color bar to show the mapping of data to color: surf(X,Y,Z) colormap hsv colorbar

Making Surfaces Transparent You can make the faces of a surface transparent to a varying degree. Transparency (referred to as the alpha value) can be specified for the whole object or can be based on an alphamap, which behaves similarly to colormaps. For example, surf(X,Y,Z) colormap hsv alpha(.4)

Illuminating Surface Plots with Lights Lighting is the technique of illuminating an object with a directional light source. In certain cases, this technique can make subtle differences in surface shape easier to see. Lighting can also be used to add realism to three-dimensional graphs. This example uses the same surface as the previous examples, but colors it red and removes the mesh lines. A light object is then added to the left of the "camera" (the camera is the location in space from where you are viewing the surface): surf(X,Y,Z,'FaceColor','red','EdgeColor','none') camlight left; lighting phong

7. Plotting Image Data About Plotting Image Data Reading and Writing Images

Two-dimensional arrays can be displayed as images, where the array elements determine brightness or color of the images. For example, the statements load durer whos Name Size Bytes Class X 648x509 2638656 double array caption 2x28 112 char array map 128x3 3072 double array load the file durer.mat, adding three variables to the workspace. The matrix X is a 648-by-509 matrix and map is a 128-by-3 matrix that is the colormap for this image.

MAT-files, such as durer MAT-files, such as durer.mat, are binary files that can be created on one platform and later read by the MATLAB software on a different platform. The elements of X are integers between 1 and 128, which serve as indices into the colormap, map. Then image(X)

colormap(map) axis image

Reading and Writing Images You can read standard image files (TIFF, JPEG, BMP, etc using the imread function. The type of data returned by imread depends on the type of image you are reading. You can write MATLAB data to a variety of standard image formats using the imwrite function

8. Printing Graphics Overview of Printing Printing from the File Menu Exporting the Figure to a Graphics File Using the Print Command

9. Understanding Handle Graphics Objects Using the Handle Graphics Objects Setting Object Properties Specifying the Axes or Figure Finding the Handles of Existing Objects

End of Getting Started

Data from User’s Guide

What Is a MATLAB Graph? The MATLAB environment offers a variety of data plotting functions plus a set of GUI tools to create, and modify graphic displays. The GUI tools afford most of the control over graphic properties and options that typed commands such as annotate, get, and set provide. A figure is a MATLAB window that contains graphic displays (usually data plots) and UI components. By default, figure windows are resizable and include pull-down menus and toolbars. A plot is any graphic display you can create within a figure window. Plots can display tabular data, geometric objects, surface and image objects, and annotations such as titles, legends, and colorbars. Figures can contain any number of plots. Each plot is created within a 2-D or a 3-D data space called an axes. A graph is a plot of data within a 2-D or 3-D axes. Most plots made with MATLAB functions and GUIs are therefore graphs.

Two-Dimensional Plotting Functions

Three-Dimensional Plotting Functions

End