Yang-Ming University, Taipei, Taiwan

Slides:



Advertisements
Similar presentations
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.
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.
Introduction to M ATLAB 2 Graphics Ian Brooks Institute for Climate & Atmospheric Science School of Earth & Environment
MA/CS375 Fall MA/CS 375 Fall 2002 Lecture 4.
Fall 2006AE6382 Design Computing1 Three Dimensional Plotting Learning Objectives –Understand the anatomy of a 3D plot –Basics of constructing plots in.
Introduction to MATLAB Northeastern University: College of Computer and Information Science Co-op Preparation University (CPU) 10/27/2003.
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:
MATLAB Week 3 17 November Outline Graphics – Basic plotting – Editing plots from GUI – Editing plots from m-file – Advanced plotting commands.
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.
EPSII 59:006 Spring Outline Managing Your Session File Usage  Saving Workspace  Loading Data Files  Creating M-files More on Matrices Review.
 1999 BG Mobasseri1 8/29/2015 MATLAB GRAPHICS - PART II ADVANCED PLOTTING June 4, ‘99.
Introduction to Matlab 7 Part III 1Daniel Baur / Introduction to Matlab Part III Daniel Baur ETH Zurich, Institut für Chemie- und Bioingenieurwissenschaften.
6.094 Introduction to programming in MATLAB
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.
Matlab Training Sessions 6,7: Plotting. Course Outline Weeks: 1.Introduction to Matlab and its Interface (Jan ) 2.Fundamentals (Operators) 3.Fundamentals.
CMPS 1371 Introduction to Computing for Engineers PLOTTING.
Plotting – 3-Dimensional. 3D Plots versus 2D Plots 3-dimensional plots, in contrast to 2-dimensional ones, has a third axis (often called the z-axis).
COMP 116: Introduction to Scientific Programming Lecture 5: Plotting, Scripts and publishing.
CDS 301 Spring, 2013 CH3: MATLAB 3-D Visualization February 07, TBD Jie Zhang Copyright ©
Lecture 2 - Matlab Introduction CVEN 302 June 5, 2002.
Barak Shenhav Early Evolution Course 11 Feb 2001 MATLAB Visualization, Functions & Debugging.
Introduction to MATLAB Session 5 Simopekka Vänskä, THL 2010.
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)
2D Routines in 3D. Outline Announcements –HW II--due Friday. 5PM HW1 & Cookie Grids & Meshes Representing f(x,y) Lines & Surfaces in 3D Survey.
Introduction to Scientific Programming in MATLAB Michael McLennan Software Architect HUBzero™ Platform for Scientific Collaboration.
EGR 115 Introduction to Computing for Engineers MATLAB Basics 4: Intro to Plotting Wednesday 10 Sept 2014 EGR 115 Introduction to Computing for Engineers.
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.
EGR 106 Lecture 6 2-D Plotting Graphical presentation has become the standard method to show technical information. Engineers use plots to analyze, visualize,
EGR 115 Introduction to Computing for Engineers 2D Plotting – Part I Wednesday 17 Sept 2014 EGR 115 Introduction to Computing for Engineers.
EGR 115 Introduction to Computing for Engineers Complex Numbers & 3D Plots – Part 2 Friday 07 Nov 2014 EGR 115 Introduction to Computing for Engineers.
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.
More Matlab Graphics and GUI Graphics subplots some useful commands 3D graphics GUI GUI controls The callback property Other essential properties.
ייצוגים גרפיים ב - MATLAB. 2 יעדים לימודיים סרטוט גרפים עם מערכת צירים xy  בחירת רזולוציה לציר ה- x  סרטוט כמה גרפים על אותה מערכת צירים  סרטוט כמה.
EEE 242 Computer Tools for Electrical Engineering
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.
Lecture 17 More Plotting Chapter 12 Matrices. Outline from Chapter D Plotting 11.4 Surface Plots 11.5 Interacting with Plotted Data.
How to use MATLAB (using M-files) Double click this icon To start Matlab 6.5.
Prof. N. P. Jadhav Presented by. Overview of MATLAB environment MATLAB is an interactive, matrix-based system for scientific and engineering numeric computation.
CS112 Scientific Computation Department of Computer Science Wellesley College Kodak moments 3-D Visualization and Color.
CS112 Scientific Computation Department of Computer Science Wellesley College Kodak moments 3-D Visualization and Color.
John Federici NJIT Physics Department
Images In Matlab.
Plotting Chapter 5.
3D-Graphs A 3D surface is defined as: z = f(x, y)
Introduction to MATLAB
Ch3 Graphics Overview of Plotting Editing Plots
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
Patches of Color.
2D Routines in 3D.
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

MATLAB How to use (using M-files)
Introduction to MATLAB Plotting LAB 3
Color Visualization in Matlab
CSCI N317 Computation for Scientific Applications Unit 1 – 5 MATLAB
Introduction to MATLAB
Introduction to MATLAB
Plotting Signals in MATLAB
Introduction to Matlab
Presentation transcript:

Yang-Ming University, Taipei, Taiwan Graphics II

Colormap

Color Map RGB Matrix of color map Red: 0~1 Green: 0~1 Blue: 0~1 R G B 0.5 1 RGB Red: 0~1 Green: 0~1 Blue: 0~1 Matrix of color map

Default cmaps help colormap Create a 20-level hot cmap gray jet hot 0.1429 0 0 0.2857 0 0 0.4286 0 0 0.5714 0 0 0.7143 0 0 0.8571 0 0 1.0000 0 0 1.0000 0.1429 0 1.0000 0.2857 0 1.0000 0.4286 0 1.0000 0.5714 0 1.0000 0.7143 0 1.0000 0.8571 0 1.0000 1.0000 0 1.0000 1.0000 0.1667 1.0000 1.0000 0.3333 1.0000 1.0000 0.5000 1.0000 1.0000 0.6667 1.0000 1.0000 0.8333 1.0000 1.0000 1.0000 help colormap gray jet hot hsv …… Create a 20-level hot cmap hot(20) colormap(hot(20))

User-Defined Color Map 1 0 0 0.1053 0.8947 0 0.0526 0.9474 0 0 0.1053 0.8947 0 0.0526 0.9474 0 0 1 0 0 0.1053 0 0 0.0526 0 0 0 . . . col1=[zeros(20,1),zeros(20,1),linspace(0,1,20)']; col2=[zeros(20,1),linspace(0,1,20)',linspace(1,0,20)']; col3=[linspace(0,1,20)',linspace(1,0,20)',zeros(20,1)]; cmap=[col1;col2;col3]; colormap(cmap); colorbar . . . . . .

製作一從黑到紅,紅到黃,黃到綠的colormap,更換無尾熊 的色階為此colormap (MATLAB會把執行結果顯示在command window上)

Graphics in 3-D

3-D Plot 3-D line plot Syntax plot3(X1,Y1,Z1,...,Xn,Yn,Zn) t = 0:pi/50:10*pi; st = sin(t); ct = cos(t); figure; plot3(st,ct,t) hold on plot3(ct,st,t) grid on 3-D line plot Syntax plot3(X1,Y1,Z1,...,Xn,Yn,Zn) t = 0:pi/50:10*pi; st = sin(t); ct = cos(t); figure; plot3(st,ct,t)

3-D Plot by Specifying Line Style Description - Solid line (default) -- Dashed line : Dotted line -. Dash-dot line Marker Description o Circle + Plus sign * Asterisk . Point x Cross s Square d Diamond ^ Upward-pointing triangle v Downward-pointing triangle > Right-pointing triangle < Left-pointing triangle p Pentagram h Hexagram Color Description y yellow m magenta c cyan r red g green b blue

3-D Plot – Specify Line Style Syntax plot3(X1,Y1,LineSpec1,...,Xn,Yn,LineSpecn) ('CLM': color, line, marker) t = 0:pi/50:10*pi; st = sin(t); ct = cos(t); figure; plot3(st,ct,t,'r-')

3-D Plot – Change Properties of Line plot3(...,'PropertyName',PropertyValue,...) Line properties Color LineStyle LineWidth Marker MarkderSize MarkerEdgeColor MarkerFaceColor …

3-D Plot – mesh Syntax mesh(X,Y,Z) mesh(Z) [X,Y] = meshgrid(-8:.5:8); R = sqrt(X.^2 + Y.^2) + eps; Z = sin(R)./R; figure; mesh(Z)

3-D Plot – surf Surface plot Syntax surf(X,Y,Z) surf(X,Y,Z,C) [X,Y] = meshgrid(1:0.5:10,1:20); Z = sin(X) + cos(Y); C = X.*Y; surf(X,Y,Z) colorbar surf(X,Y,Z,C) Surface plot Syntax surf(X,Y,Z) surf(X,Y,Z,C) The function plots the values in matrix Z as heights above a grid in the x-y plane defined by X and Y.

3-D Sphere Plot figure; sphere % Create a 20-by-20 faces sphere

3-D Sphere Plot [x,y,z] = sphere; figure; surf(x,y,z) hold on surf(x+3,y-2,z) % centered at (3,-2,0) surf(x,y+1,z-3) % centered at (0,1,-3) [x,y,z] = sphere; figure; mesh(x,y,z)

3-D Plot – patch Create one or more filled polygons Syntax patch(X,Y,C) patch(X,Y,Z,C) x = [2 5; 2 5; 8 8]; y = [4 0; 8 2; 4 0]; c = [0; 1]; figure; patch(x,y,c) colorbar

3-D Plot – patch figure; Pl_lat = patch('Faces', data.faces_l, 'Vertices', data.vertices_l, 'FaceColor', [0.8 0.8 0.8], 'EdgeColor', 'none', 'Facealpha', 0.5); view(gca, -90,0); light(gca, 'Style', 'infinite', 'Position', [0 1 0]) set(Pl_lat, 'FaceLighting', 'gouraud'); light(gca, 'Style', 'infinite', 'Position', [0 -1 0]) light(gca, 'Style', 'infinite', 'Position', [-1 0 0]) set(gca, 'Color', [0 0 0])

在command window輸入“L = 160*membrane(1,100);” 使用“surface”畫圖 去除edgecolor Create a matlab logo 在command window輸入“L = 160*membrane(1,100);” 使用“surface”畫圖 去除edgecolor 調整圖軸為X: [1 201], Y: [1 201], Z: [-53.4 160] 打兩道光:一為位置在[160 400 80]顏色為[0 0.8 0.8]的光, 另一為位置在[.5 -1 .4];顏色為[0.8 0.8 0]的光 更改物體顏色為[0.9 0.2 0.2] 更改背景顏色為黑色並將圖軸去除 (MATLAB會把執行結果顯示在command window上)

Thank you for your attention!!