Lesson 6: basic plots. Lesson 6 Outline: Plot 1-basic plot commands 1) Figure Line style Marker style Labels and Titles Axes Matlab help LineSpec (colors,

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

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.
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.
Matrix Manipulation and 2D Plotting
Slide deck by Dr. Greg Reese Miami University MATLAB An Introduction With Applications, 5 th Edition Dr. Amos Gilat The Ohio State University Chapter 5.
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.
MATLAB GRAPHICS 2-D.
Graphics in MATLAB Week 15 – 5/5/09 Kate Musgrave
MATLAB - Lecture 22A Two Dimensional Plots / Chapter 5 Topics Covered:
Graph these numbers. 1. Highlight the rows you need for your axes 2. Click on the chart wizard icon.
Using Excel for Data Analysis in CHM 161 Monique Wilhelm.
EGR106 Week 6 MATLAB FILES Two Dimensional Plots Multiple Plots
EGR106 Week 5 MATLAB FILES Two Dimensional Plots Multiple Plots Plot Formatting Homework.
MATLAB Week 3 17 November Outline Graphics – Basic plotting – Editing plots from GUI – Editing plots from m-file – Advanced plotting commands.
MATLAB TUTORIAL Dmitry Drutskoy Some material borrowed from the departmental MATLAB info session by Philippe Rigollet Kevin Wayne.
EGR106 Week 4 Two Dimensional Plots Multiple Plots Plot Formatting Homework.
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
Chapter 5 Review: Plotting Introduction to MATLAB 7 Engineering 161.
SUNY-New Paltz Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz “Lecture 5”
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 Training Sessions 6,7: Plotting. Course Outline Weeks: 1.Introduction to Matlab and its Interface (Jan ) 2.Fundamentals (Operators) 3.Fundamentals.
„  1999 BG Mobasseri1 9/18/2015 June 2 GRAPHICS IN MATLAB- PART I BASIC PLOTTING.
The Hong Kong Polytechnic University Industrial Centre 1 MatLAB Lesson 3 : Graphics Edward Cheung Room W311g 2008m.
ELG 3120 Signal and System Analysis 1 Introduction to MATLAB TAs Wei Zhang Ozgur Ekici (Section A)(Section B) ELG 3120 Lab Tutorial 1.
MATLAB Tutorial EE 327 Signals and Systems 1. What is MATLAB? MATLAB – Matrix Laboratory The premier number-crunching software Extremely useful for signal.
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.
This is what a blank excel workbook looks like. To start there are three separate sheets on which to store data. Down the left side are the ROW labels.
Outline Comparison of Excel and R R Coding Example – RStudio Environment – Getting Help – Enter Data – Calculate Mean – Basic Plots – Save a Coding Script.
SUNY-New Paltz Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz “Lecture 9”
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.
Matlab Screen  Command Window  type commands  Current Directory  View folders and m-files  Workspace  View program variables  Double click on a.
11/25/2015Slide 1 Scripts are short programs that repeat sequences of SPSS commands. SPSS includes a computer language called Sax Basic for the creation.
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,
ELG 3120 Lab 2 TAs Wei Zhang Ozgur Ekici (Section A) (Section B)
Using Sheets To help with data. Sheets is a spreadsheet program that can interface with forms, docs, or presentations. A spreadsheet program has cells.
1 Lecture 5 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Parts of Speech Review You should have a whiteboard, a marker, and your brain – everything you need! Your row is your team! Winner is the team with the.
Introduction to Engineering MATLAB – 9 Plotting - 2 Agenda Formatting plots.
ENGR 1181 College of Engineering Engineering Education Innovation Center Excel Graphing.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Lab 2 : potting to Matlab Networks.
COURS - LES SPORTS BUT! During this lesson I will display the results of my class survey on where we live, using Microsoft Excel chart wizard.
Charts MOAC Lesson 6.
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.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
Charts MOAC Lesson 6.
John Federici NJIT Physics Department
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.
Excel Lesson 8 Managing Worksheets.
Managing Worksheets Excel Lesson 8.
Matrices and Arrays.
MatLab – Palm Chapter 5 2-D & 3-D 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)
MATLAB How to use (using M-files) Double click this icon
MATLAB How to use (using M-files) Double click this icon
Code is on the Website Outline Comparison of Excel and R
Charts MOAC Lesson 6.
Plotting Signals in MATLAB
Simulate Multiple Dice
Presentation transcript:

Lesson 6: basic plots

Lesson 6 Outline: Plot 1-basic plot commands 1) Figure Line style Marker style Labels and Titles Axes Matlab help LineSpec (colors, marker styles, line styles) 2) Matlab program for basic plots L6_plots.m line plots: 1D with time Multiple data sets 1D across time scatter plots: 2D bar plots : Hx 3) Subplots 4) Managing plots visible off pause saveas 5 ) Play with zoom

x=rand(20,10); figure plot(x(:,10)) plot(x(:,9)) hold on plot(x(:,10),’r’)

figure plot(x(:,5),'--b','LineWidth',2) plot(x(:,4),':ko','LineWidth',2) hold on plot(x(:,3),'-md','LineWidth’ 2, 'MarkerEdgeColor’, 'k', 'MarkerFaceColor', 'g', 'MarkerSize', 10) close all

MatLab help search  LineSpec colors line styles marker styles 5 minutes to play

xlabel(‘time') axis([xmin xmax ymin ymax]) title(’random x plot') ylabel(’column_5') axis([ ])

Uncomment the next plot command L6_plots.m highlight lines open the m file from your current directory right click and “uncomment” save run the program

What are we plotting? Let’s look at the code Run the program and see if you were correct. Is it a line? What color? Are there markers? plot(x,'b') hold on plot(y,'r') hold on

Uncomment the next plot command highlight lines right click and “uncomment” save

What are we plotting? Let’s look at the code Run the program and see if you were correct. Is it a line? What color? Are there markers? plot(x,y,'b*');

Uncomment the next plot command highlight lines right click and “uncomment” save

What are we plotting? Let’s look at the code Run the program and see how it looks. Is it a line? What color? Are there markers? hist(z) In command window type help hist

What is the default bin size? hist(z,25) hist(z,50) Try changing the bin size

Uncomment the next plot command highlight lines right click and “uncomment” save

What are we plotting? Let’s look at the code Run the program and see if you were correct. Is it a line? What color? Are there markers? subplot(3,2,1);plot(x,’r’); subplot(3,2,2);plot(y,’b’); subplot(3,2,3);plot(x2,’-rd’); subplot(3,2,4);plot(y2,’:mo’); subplot(3,2,5);plot(x3,’- -k’); subplot(3,2,6);plot(y3, ‘-.g’);

subplot(3,2,1); subplot(3,2,2); subplot(3,2,3); subplot(3,2,4); subplot(3,2,5); subplot(3,2,6); 3 rows 2 columns 6 plots

Managing figures where are they? stops the program put a pause after each figure (copy and paste line 76) Save run the program How many figures were made when you ran the program? “pause”

What if you do not want to see the figures? How can you save them to a file? creating a figure “handle” saveas(fig_x,[outpath,’xy_scatter.tif’]); copy and paste line 77 adjust figure “handle” and name of file set(fig_x,’visible’,’off’)’; copy and paste line 75 adjust figure “handle” for this line fig_x=figure; % pause be sure to comment out the pauses

Select area you want enlarged Using zoom on Matlab plots Save as Click on zoom at top of figure + +

Enjoy playing with Matlab plots!!!