Plotting Selim Aksoy Bilkent University Department of Computer Engineering

Slides:



Advertisements
Similar presentations
Computation for Physics 計算物理概論
Advertisements

CSE 123 Plots in MATLAB. Easiest way to plot Syntax: ezplot(fun) ezplot(fun,[min,max]) ezplot(fun2) ezplot(fun2,[xmin,xmax,ymin,ymax]) ezplot(fun) plots.
Introduction to Engineering MATLAB – 11 Plotting - 4 Agenda Multiple curves Multiple plot.
Lecture (4) Plotting & Programming (1) Eng. Osama Talaat 1.
2D Plots 1 ENGR 1181 MATLAB 12.
ENGR-25_Plot_Model-2.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
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.
Matrix Manipulation and 2D Plotting
Introduction to MATLAB for Biomedical Engineering BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Lesson 2: Element-wise vs. matrix operations.
MATLAB - Basics Centro de Informática Universidade Federal de Pernambuco Aprendizagem de Máquina – IN1102 Arley Ristar –
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.
Introduction to MATLAB Northeastern University: College of Computer and Information Science Co-op Preparation University (CPU) 10/27/2003.
MATLAB - Lecture 22A Two Dimensional Plots / Chapter 5 Topics Covered:
EGR106 Week 6 MATLAB FILES Two Dimensional Plots Multiple Plots
Chapter 2 MATLAB Fundamentals.
Vectors and Plotting Selim Aksoy Bilkent University Department of Computer Engineering
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,
EPSII 59:006 Spring Outline Managing Your Session File Usage  Saving Workspace  Loading Data Files  Creating M-files More on Matrices Review.
Designing Effective Graphics Using MATLAB The Cain Project in Engineering and Professional Communication ENGINEERING SERIES.
Chapter 5 Review: Plotting Introduction to MATLAB 7 Engineering 161.
MATLAB INTRO CONTROL LAB1  The Environment  The command prompt Getting Help : e.g help sin, lookfor cos Variables Vectors, Matrices, and Linear Algebra.
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()
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.
ELG 3120 Signal and System Analysis 1 Introduction to MATLAB TAs Wei Zhang Ozgur Ekici (Section A)(Section B) ELG 3120 Lab Tutorial 1.
How to Use MATLAB A Brief Introduction. 2 What can MATLAB do? Matrix Operations Symbolic Computations Simulations Programming 2D/3D Visualization.
Matlab Programming for Engineers Dr. Bashir NOURI Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
Lecture 2 - Matlab Introduction CVEN 302 June 5, 2002.
Statistics and Simple Plots. Outline Announcements: –Homework II: due Today. by 5, by Statistics Simple 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)
UW CSE 190p Section 7/26, Summer 2012 Dun-Yu Hsiao.
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,
1. Overview 2. plot in 2D 3. Plot in 3D 4. Other possible charts 5. Engineers: label your plots! 6. Plots & Polynomial Plotting 11.
EGR 115 Introduction to Computing for Engineers 2D Plotting – Part I Wednesday 17 Sept 2014 EGR 115 Introduction to Computing for Engineers.
1 Lecture 5 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
GRAPHICS AND VISUALISATION WITH MATLAB UNIVERSITY OF SHEFFIELD CiCS DEPARTMENT Deniz Savas & Mike Griffiths May 2015.
Introduction to Engineering MATLAB – 9 Plotting - 2 Agenda Formatting plots.
MATLAB ® for Engineers, Holly Moore Fourth Edition, Global Edition © Pearson Education Limited 2015 All rights reserved. Figure 5.1 Simple Plot of Time.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Lab 2 : potting to Matlab Networks.
Plotting. 2 Initializing Vectors colon operator x = 1:2:10 x = y = 0:0.1:0.5 y =
Outline What is MATLAB MATLAB desktop Variables, Vectors and Matrices Matrix operations Array operations Built-in functions: Scalar, Vector, Matrix Data.
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.
Prof. N. P. Jadhav Presented by. Overview of MATLAB environment MATLAB is an interactive, matrix-based system for scientific and engineering numeric computation.
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.
Plotting Chapter 5.
3D-Graphs A 3D surface is defined as: z = f(x, y)
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
Matrices and Arrays.
Net 222: Communications and networks fundamentals (Practical Part)
Net 222: Communications and networks fundamentals (Practical Part)
Net 222: Communications and networks fundamentals (Practical Part)
MATLAB How to use (using M-files) Double click this icon
MATLAB How to use (using M-files) Double click this icon
Plotting Multiple Graphs In The Same Plot
MATLAB How to use (using M-files)
Introduction to MATLAB Plotting LAB 3
Plotting Signals in MATLAB
How to Use MATLAB A Brief Introduction.
Introduction to Matlab
Presentation transcript:

Plotting Selim Aksoy Bilkent University Department of Computer Engineering

Fall 2004CS 1112 Plotting x = linspace(0, 4*pi); y = sin(x); plot(x,y); title( 'sin(x) for [0,4\pi]' ); xlabel( 'x' ); ylabel( 'y' ); grid on; axis( [ 0 4*pi -1 1 ] );

Fall 2004CS 1113 Plotting: Multiple Graphs x = linspace(0, 4*pi); y1 = sin(x); y2 = sin(x).^ 2; y3 = y1 + y2; plot(x,y1,'b-'); hold on; plot(x,y2,'r--'); plot(x,y3,'g:'); hold off;

Fall 2004CS 1114 Plotting: Multiple Graphs x = linspace(0, 4*pi); y1 = sin(x); y2 = sin(x).^ 2; y3 = y1 + y2; plot(x,y1,x,y2,x,y3); legend( 'sin(x)',... 'sin(x)^2',... 'sin(x) + sin(x)^2' );

Fall 2004CS 1115 Plotting: Subplots x = -2:0.1:4; y = 3.5.^ (-0.5*x).*... cos(6*x); figure(1); subplot(2,1,1); plot(x,y,'r-o'); subplot(2,1,2); plot(x,y,'k--*'); print -f1 -dtiff myplot.tif

Fall 2004CS 1116 Plotting: Logarithmic Plots r = 16000; c = 1.0e-6; f = 1:2:1000; res = 1./ ( 1 + j*2*pi*f*r*c ); amp = abs(res); phase = angle(res); subplot(2,1,1); loglog(f,amp); title( 'Amplitude response' ); xlabel( 'Frequency (Hz)' ); ylabel( 'Output/Input ratio' ); grid on; subplot(2,1,2); semilogx(f,phase); title( 'Phase response' ); xlabel( 'Frequency (Hz)' ); ylabel( 'Output-Input phase (rad)' ); grid on;

Fall 2004CS 1117 Plotting Summary plot(x,y) linear plot of vector y vs. vector x title('text'), xlabel('text'), ylabel('text') labels the figure, x-axis and y-axis grid on/off adds/removes grid lines hold on/off allows/disallows adding subsequent graphs to the current graph

Fall 2004CS 1118 Plotting Summary legend( 'string1', 'string2', 'string3',... ) adds a legend using the specified strings v = axis returns a row vector containing the scaling for the current plot axis( [ xmin xmax ymin ymax ] ) sets axes’ limits

Fall 2004CS 1119 Plotting Summary line colorline markerline style bgrcmykbgrcmyk blue green red cyan magenta yellow black.ox+*sdv^<>ph.ox+*sdv^<>ph point circle x-mark plus star square diamond triangle (down) triangle (up) triangle (left) triangle (right) pentagram hexagram - : solid dotted dashdot dashed

Fall 2004CS Plotting Summary semilogy(x,y), semilogx(x,y), loglog(x,y) logarithmic plots of vector y vs. vector x figure(k) makes figure k the current figure subplot(m,n,p) breaks the figure window into an m-by-n matrix of small axes and selects the p th axes for the current plot clf clears current figure

Fall 2004CS Plotting Summary print –f -d saves the figure with the given handle in the format specified by the device -depsEncapsulated PostScript -depscEncapsulated Color PostScript -deps2Encapsulated Level 2 PostScript -depsc2Encapsulated Level 2 Color PostScript -djpeg JPEG image with quality level of nn -dtiffTIFF image -dpngPortable Network Graphics image

Fall 2004CS Plotting Examples Line plot x = -2:0.01:4; y = 3.5.^(-0.5*x).*cos(6*x); plot(x,y); line([0 0],[-3 3],'color','r'); Pie plot grades = [ ]; pie(grades);

Fall 2004CS Plotting Examples Vertical bar plot y = 1988:1994; s = [ ]; bar(y,s,'r'); Horizontal bar plot y = 1988:1994; s = [ ]; barh(y,s,'g');

Fall 2004CS Plotting Examples Stairs plot y = 1988:1994; s = [ ]; stairs(y,s); Stem plot y = 1988:1994; s = [ ]; stem(y,s);

Fall 2004CS Plotting Examples Histogram x = randn(1,100); hist(x,10); hist(x,20);

Fall 2004CS Plotting Examples Polar plot t = linspace(0,2*pi,200); r = 3 * cos(0.5*t).^2 + t; polar(t,r); Compass plot u = [ ]; v = [ ]; compass(u,v);

Fall 2004CS Plotting Examples Error bar plot x = 1:10; y = sin(x); e = std(y) * ones(size(x)); errorbar(x,y,e);