Introduction to Engineering MATLAB – 9 Plotting - 2 Agenda Formatting plots.

Slides:



Advertisements
Similar presentations
Lab # 03- SS Basic Graphic Commands. Lab Objectives: To understand M-files principle. To plot multiple plots on a single graph. To use different parameters.
Advertisements

Introduction to Engineering MATLAB – 11 Plotting - 4 Agenda Multiple curves Multiple plot.
Plotting Selim Aksoy Bilkent University Department of Computer Engineering
Lecture (4) Plotting & Programming (1) Eng. Osama Talaat 1.
2D Plots 1 ENGR 1181 MATLAB 12.
Introduction to Graphing Using MATLAB. Line Graphs  Useful for graphing functions  Useful for displaying data trends over time  Useful for showing.
Matlab Graphics S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Introduction to Matlab: 2D Graphics.
Introduction to MATLAB for Biomedical Engineering BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Lesson 2: Element-wise vs. matrix operations.
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.
MA/CS375 Fall MA/CS 375 Fall 2002 Lecture 4.
Scripts and Flow Control. Scripts So far we have been entering commands directly into the command line But there is a better way Script files (and functions)
MATLAB - Lecture 22A Two Dimensional Plots / Chapter 5 Topics Covered:
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.
EGR106 Week 4 Two Dimensional Plots Multiple Plots Plot Formatting Homework.
Introduction to Matlab 332:202 Discrete Mathematics Spring 2007.
Lecture 9 Plotting in 2-D Plotting in 2-D, Plotting Multiple Curves, Plotting with Figures, Plot Settings, Scaling, Legends © 2007 Daniel Valentine. All.
Plotting. Basic Plotting Two vectors of x and y values needed. Vectors need to be of the same length, but not necessarily of the same geometry. For example,
An introduction to Plotting in MATLAB Rikard Johansson Department of Biomedical Engineering (IMT) Linköping University
For loop Khairul anwar.
Chapter 5 Review: Plotting Introduction to MATLAB 7 Engineering 161.
MATLAB AutoCAD Visio Rational Rose Computer Applications in Engineering Design Introductory Lecture LabVIEW PSPICE Orcad.
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()
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers Chapter 5 Advanced.
ELG 3120 Signal and System Analysis 1 Introduction to MATLAB TAs Wei Zhang Ozgur Ekici (Section A)(Section B) ELG 3120 Lab Tutorial 1.
Ranjeet Department of Physics & Astrophysics University of Delhi Working with Origin.
COMP 116: Introduction to Scientific Programming Lecture 5: Plotting, Scripts and publishing.
Introduction to MATLAB Damon Tomlin February 22, 2008 Lecture 3: Data Visualization & User Interfaces.
MAE 1202: AEROSPACE PRACTICUM An Introduction to MATLAB: Part 2 Mechanical and Aerospace Engineering Department Florida Institute of Technology Developed.
Summer 2007 NSF MSPPaul Beaulieu / Barbara Perez Excel III Graphing Data.
© 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Creating Charts Lecture 19.
Graph Some basic instructions
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers Chapter 5 Advanced.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
S5-1 ADM740, Section 5, June 2007 Copyright  2007 MSC.Software Corporation SECTION 5 PLOT CONFIGURATION FILES.
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.
Barbara/Pratik/Yu. Outline Matlab desktop M-files Variables Arrays Plots.
ENG 1181 College of Engineering Engineering Education Innovation Center MATLAB – 2D Plots 1 Go to the class drive: ---> MatLab - Graphing ---> Seed Files.
Plot (x-values, y-values) >> x = linspace (-3, 3, 20); >> x = linspace (-3, 3, 20); >> y = 2*x – 1; >> y = 2*x – 1; >> plot (x, y) >> plot (x, y)
Introduction to Engineering MATLAB – 7 Script Files - 2 Agenda Script files continued.
EGR 106 Lecture 6 2-D Plotting Graphical presentation has become the standard method to show technical information. Engineers use plots to analyze, visualize,
First Step: Open a Microsoft Word document and save it by the name of your choice.
XP New Perspectives on Microsoft Excel 2002 Tutorial 4 1 Microsoft Excel 2002 Tutorial 4 – Working With Charts and Graphs.
EGR 115 Introduction to Computing for Engineers 2D Plotting – Part I Wednesday 17 Sept 2014 EGR 115 Introduction to Computing for Engineers.
Introduction to Matlab  Matlab is a software package for technical computation.  Matlab allows you to solve many numerical problems including - arrays.
Introduction to Drafting and Design In order to begin our drawing we have to set the drawing limits or the paper size.
EGR 115 Introduction to Computing for Engineers
Introduction to Matlab Module #10 Page 1 Introduction to Matlab Module #10 – Creating Graphical User Interfaces Topics 1.Overview of GUI Development using.
Introduction to MATLAB ENGR 1181 MATLAB 1. MATLAB Built-in Math Functions  Pre-defined in MATLAB ready for use exp(x) – exponential (e x ) log(x) – natural.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Lab 2 : potting to Matlab Networks.
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.
How to use MATLAB (using M-files) Double click this icon To start Matlab 6.5.
Session III Plotting in MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU MATLAB Tutorials.
Chapter 5 EXCEL Graphing Data. Intro In EXCEL graphs are referred to as CHARTS. We will do 2-D graphs known as Scatter Charts or X-Y Charts. Vocabulary:
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.
Lecture 25.
Course Information Do not rely on color to distinguish curves (due to black-white printout). Use different line styles to distinguish curves (solid, dashed,
Lecture 25: Exploring data
Two-Dimensional Plots
Net 222: Communications and networks fundamentals (Practical Part)
Net 222: Communications and networks fundamentals (Practical Part)
Net 222: Communications and networks fundamentals (Practical Part)
Assignment #12 “Off the chart!”
MATLAB How to use (using M-files) Double click this icon
MATLAB How to use (using M-files) Double click this icon
Plotting Data with MATLAB
MATLAB How to use (using M-files)
Plotting Signals in MATLAB
Presentation transcript:

Introduction to Engineering MATLAB – 9 Plotting - 2 Agenda Formatting plots

FORMATTING PLOTS A plot can be formatted to have a required appearance. With formatting you can:  Add title to the plot.  Add labels to axes.  Change line type, thickness, and color of the plot line.  Change range of the axes.  Add legend.  Add text blocks.  Add grid.

FORMATTING PLOTS There are two methods to format a plot: 1.Formatting commands. In this method commands, that make changes or additions to the plot, are entered after the plot command. This can be done when working in the command window, or as part of a program in a script file. 2.Formatting the plot in the figure window. In this method the plot is formatted by clicking on the plot and using the menu to make changes or add details.

FORMATTING PLOTS The plot command can include options that define the line (color, style, color) of line that is used in plotting the curve. plot(x,y,’color_linestyle_marker’) ColorColor LineLine MarkerMarker Code CodeType Code yyellow-solid.point mmagenta:dottedocircle ccyan-.Dashdotxx-mark rred--dashed+plus ggreen*star bbluessquare wwhiteddiamond kblackvtriangle

EXAMPLES OF THE PLOT COMMAND plot(x,y,’r’)Plots y vs. x with a red solid (default) line. plot(x,y,’--’)Plots y vs. x with a black (default) dashed line. plot(x,y,’g:’)Plots y vs. x with a green dotted line. plot(x,y,’+’)Plots y vs. x as points marked with + (no line connects the points) plot(x,y,’b*-.’)Plots y vs. x with points marked with stars and blue dashdot line that connects the points.

FORMTTING COMMANDS title(‘string’)Add the string as a title at the top of the plot. xlabel(‘string’)Add the string as a label to the x-axis. ylabel(‘string’)Add the string as a label to the y-axis. axis([xmin xmax ymin ymax])Sets the min and max limits of the x- and y-axes.

FORMTTING COMMANDS legend(‘string 1’,’string 2’,’string 3’) Creates a legend using the strings to label various curves (when several curves are in one plot). The location of the legend is specified by the mouse. text(x,y,’string’) Places the string (text) on the plot at coordinate x,y relative to the plot axes. gtext(‘string’) Places the string (text) on the plot. When the command executes the figure window pops up and the text location is clicked with the mouse.

EXAMPLE OF FORMATTED PLOT Below is a script file of a formatted population growth plot year = [ ]; pop =[ ]; plot(year,pop,‘g--s') xlabel('YEAR') ylabel('POPULATION (MILLIONS)') title('Population Growth From 1984 to 1996') axis([ ]) text(1984,220,'Data from Reference [3]') Creating a vector of the years numbers Plotting pop vs. year with a dashed green line and square markers Creating a vector with the population data Labels for the axes Title for the plot Setting limits of the axes Creating text

POPULATION GROWTH PLOT AFTER FORMATTING

FORMATTING A PLOT IN THE FIGURE WINDOW Once a figure window is open, the figure can be formatted interactively. Use Figure, Axes, and Current Object- Properties in the Edit menu Use the arrow and click at different points on the figure (line, axes, etc.) to edit the figure. Use the insert menu to

ASSIGNMENT 6: 1.Problem 3 page 303 in the textbook. 2.Problem 6 page 303 in the textbook. 3. Problem 14 page 304 in the textbook. 4. Problem 15 page 305 in the textbook. In each problem submit the plot. In each plot place your name as part of the plot using the text or gtext command.