The language of Technical Computing

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Author(s): MathWorks
Series: Getting Started with MATLAB
Publisher: General Books LLC
Year: 2004

Language: English
Pages: 702
Tags: Библиотека;Компьютерная литература;Matlab / Simulink;

Graphics......Page 21
MATLAB Plotting Tools......Page 23
Figure ToolBars......Page 24
Plotting Tools Interface Overview......Page 26
The Figure Palette......Page 29
The Plot Browser......Page 33
The Property Editor......Page 37
Accessing All Object Properties — Property Inspector......Page 38
Example — Working with Plotting Tools......Page 40
Adding a Subplot......Page 42
Example — Plotting Workspace Variables......Page 47
Plotting Expressions......Page 49
Varying the Data Source......Page 52
Data Sources for Multiobject Graphs......Page 54
Example — Generating M-Code to Reproduce a Graph......Page 56
Limitations......Page 57
Using Functions to Edit Graphs......Page 58
Using Plot Edit Mode......Page 59
Selecting Objects in a Graph......Page 60
Moving and Resizing Objects......Page 61
Undo/Redo — Eliminating Mistakes......Page 62
Saving a Graph in MAT-File Format......Page 64
Saving to a Different Format — Exporting Figures......Page 65
Generating an M-File to Recreate a Graph......Page 66
Data Exploration Tools......Page 69
Types of Tools......Page 70
Enabling Data Cursor Mode......Page 71
Display Style — Datatip or Cursor Window......Page 75
Selection Style — Select Data Points or Interpolate Points on Graph......Page 76
Exporting Data Value to Workspace Variable......Page 77
Zooming in 2-D Views......Page 79
2-D vs. 3-D Panning......Page 82
Rotation Style for Complex Graphs......Page 83
Undo/Redo — Eliminating Mistakes......Page 85
Basic Curve Fitting......Page 86
Adding Plots of Basic Statistics to Graphs......Page 88
Example — Plotting the Mean of a Data Set......Page 89
Formatting Plots of Data Statistics......Page 91
Statistics Plotted by the Data Statistics Tool......Page 92
Viewing Statistics for Multiple Plots......Page 93
Saving Statistics to the MATLAB Workspace......Page 94
Annotating Graphs......Page 97
Graph Annotation Features......Page 98
Enclosing Regions of a Graph in a Rectangle or an Ellipse......Page 101
Textbox Annotations......Page 103
Annotation Lines and Arrows......Page 106
Adding a Colorbar to a Graph......Page 109
Adding a Legend to a Graph......Page 111
Pinning — Attaching to a Point in the Figure......Page 113
Alignment Tool — Aligning and Distributing Objects......Page 116
Example — Vertical Distribute, Horizontal Align......Page 117
Align/Distribute Menu Options......Page 119
Snap to Grid — Aligning Objects on a Grid......Page 121
Adding Titles to Graphs......Page 123
Using the Property Editor to Add a Title......Page 124
Using the title Function......Page 125
Adding Axis Labels to Graphs......Page 126
Using the Property Editor to Add Axis Labels......Page 127
Using Axis-Label Commands......Page 129
Adding Text Annotations to Graphs......Page 132
Creating Text Annotations with the text or gtext Command......Page 133
Text Alignment......Page 136
Example — Aligning Text......Page 137
Editing Text Objects......Page 138
Mathematical Symbols, Greek Letters, and TEX Characters......Page 139
Using Character and Numeric Variables in Text......Page 141
Example — Multiline Text......Page 142
Drawing Text in a Box......Page 143
Creating Arrows and Lines in Plot Editing Mode......Page 145
Editing Arrows and Line Annotations......Page 146
Basic Plotting Commands......Page 147
Plotting Steps......Page 148
Creating Line Plots......Page 149
Specifying Line Style......Page 151
Specifying the Color and Size of Lines......Page 153
Adding Plots to an Existing Graph......Page 154
Plotting Only the Data Points......Page 155
Plotting Markers and Lines......Page 156
Line Styles for Black and White Output......Page 157
Setting Default Line Styles......Page 158
Line Plots of Matrix Data......Page 160
Plotting Imaginary and Complex Data......Page 162
Combining Linear and Logarithmic Axes......Page 163
Axis Limits and Ticks......Page 166
Example — Specifying Ticks and Tick Labels......Page 169
Setting Aspect Ratio......Page 170
Displaying Multiple Plots per Figure......Page 173
Default Color Scheme......Page 175
Creating Specialized Plots......Page 177
Types of Bar Graphs......Page 178
Stacked Bar Graphs to Show Contributing Amounts......Page 181
Specifying X-Axis Data......Page 183
Overlaying Plots on Bar Graphs......Page 185
Area Graphs......Page 187
Comparing Data Sets with Area Graphs......Page 188
Pie Charts......Page 190
Removing a Piece from a Pie Chart......Page 192
Histograms in Cartesian Coordinate Systems......Page 193
Histograms in Polar Coordinates......Page 195
Specifying Number of Bins......Page 196
Two-Dimensional Stem Plots......Page 198
Combining Stem Plots with Line Plots......Page 201
Three-Dimensional Stem Plots......Page 202
Stairstep Plots......Page 205
Compass Plots......Page 207
Feather Plots......Page 208
Two-Dimensional Quiver Plots......Page 210
Three-Dimensional Quiver Plots......Page 211
Creating Simple Contour Plots......Page 213
Labeling Contours......Page 215
Filled Contours......Page 216
Drawing a Single Contour Line at a Desired Level......Page 217
The Contouring Algorithm......Page 218
Changing the Offset of a Contour......Page 219
Displaying Contours in Polar Coordinates......Page 220
Interactive Plotting......Page 224
Movies......Page 226
Example — Visualizing an FFT as a Movie......Page 227
Erase Modes......Page 228
Displaying Bit-Mapped Images......Page 233
Overview......Page 234
Data Types......Page 236
Indexed Images......Page 238
Intensity Images......Page 239
RGB (Truecolor) Images......Page 241
8-Bit and 16-Bit Indexed Images......Page 243
8-Bit and 16-Bit RGB Images......Page 244
Other 8-Bit and 16-Bit Array Support......Page 245
Converting an 8-Bit RGB Image to Grayscale......Page 246
Summary of Image Types and Numeric Classes......Page 248
Reading a Graphics Image......Page 249
Obtaining Information About Graphics Files......Page 250
Displaying Graphics Images......Page 252
Controlling Aspect Ratio and Display Size......Page 253
Image CDataMapping......Page 257
XData and YData......Page 258
EraseMode......Page 260
Printing Images......Page 262
Converting the Data or Graphic Type of Images......Page 263
Printing and Exporting......Page 265
Graphical User Interfaces......Page 266
Command Line Interface......Page 267
Specifying Parameters and Options......Page 269
Default Settings and How to Change Them......Page 270
Using Print Preview......Page 273
Printing a Figure......Page 275
Printing to a File......Page 279
Exporting to a File......Page 281
Exporting to the Windows Clipboard......Page 291
Printing a Figure at Screen Size......Page 294
Printing with a Specific Paper Size......Page 295
Printing a Centered Figure......Page 296
Exporting in a Specific Graphics Format......Page 297
Exporting in EPS Format with a TIFF Preview......Page 298
Exporting a Figure to the Clipboard......Page 299
Changing a Figure’s Settings......Page 302
Selecting the Printer......Page 304
Setting the Figure Size and Position......Page 305
Setting the Paper Size or Type......Page 309
Setting the Paper Orientation......Page 310
Selecting a Renderer......Page 312
Setting the Resolution......Page 315
Setting the Axes Ticks and Limits......Page 318
Setting the Background Color......Page 320
Setting Line and Text Characteristics......Page 321
Setting the Line and Text Color......Page 323
Setting CMYK Color......Page 325
Producing Uncropped Figures......Page 326
Choosing a Graphics Format......Page 328
Frequently Used Graphics Formats......Page 329
Factors to Consider in Choosing a Format......Page 330
Properties Affected by Choice of Format......Page 332
Description of Selected Graphics Formats......Page 334
How to Specify a Format for Exporting......Page 338
Types of Printer Drivers......Page 339
Factors to Consider in Choosing a Driver......Page 340
Driver-Specific Information......Page 343
How to Specify the Printer Driver to Use......Page 347
Troubleshooting......Page 349
Printing Problems......Page 350
Exporting Problems......Page 353
General Problems......Page 356
Handle Graphics Objects......Page 359
Organization of Graphics Objects......Page 361
Information on Specific Graphics Objects......Page 362
Graphics Windows — the Figure......Page 363
Figures Used for GUIs......Page 364
More Information on Figures......Page 365
Core Graphics Objects......Page 366
Description of Core Graphics Objects......Page 369
Example — Creating Core Graphics Objects......Page 370
High-Level Versus Low-Level......Page 372
Simplified Calling Syntax......Page 373
Plot Objects......Page 375
Creating a Plot Object......Page 376
Linking Graphs to Variables — Data Source Properties......Page 377
Plot Objects and Backward Compatibility......Page 378
Example — Enclosing Subplots with an Annotation Rectangle......Page 380
Creating a Group......Page 383
Transforming Objects......Page 384
Example — Transforming a Hierarchy of Objects......Page 389
Default Values......Page 393
Properties Common to All Objects......Page 394
Setting Property Values......Page 396
Querying Property Values......Page 398
Factory-Defined Property Values......Page 400
How MATLAB Searches for Default Values......Page 401
Defining Default Values......Page 403
Examples — Setting Default Line Styles......Page 404
The Current Figure, Axes, and Object......Page 408
Searching for Objects by Property Values — findobj......Page 410
Copying Objects......Page 414
Deleting Objects......Page 416
Preparing Figures and Axes for Graphics......Page 418
Targeting Graphics Output with newplot......Page 420
Example — Using newplot......Page 421
Testing for Hold State......Page 423
Protecting Figures and Axes......Page 424
The Figure Close Request Function......Page 426
Handle Validity Versus Handle Visibility......Page 428
Saving Handles in M-Files......Page 429
Properties Changed by Built-In Functions......Page 430
Using Panel Containers in Figures — UIPanels......Page 433
Example — Using Figure Panels......Page 434
Grouping Objects Within Axes — hgtransform......Page 438
Figure Callbacks......Page 442
Function Handle Syntax......Page 444
Why Use Function Handle Callbacks......Page 446
The GUI Layout......Page 448
Initialize the GUI......Page 449
The Callback Functions......Page 450
Figure Properties......Page 453
Related Information About Figures......Page 454
Docking Figures in the Desktop......Page 455
Creating a Nondockable Figure......Page 456
The Position Vector......Page 457
Example — Specifying Figure Position......Page 459
Specifying the Figure Colormap......Page 461
Double Buffering......Page 462
Selecting a Renderer......Page 463
Specifying the Figure Pointer......Page 465
Defining Custom Pointers......Page 466
Axes Properties......Page 471
Axes Objects — Defining Coordinate Systems for Graphs......Page 472
Creating Axes with Specific Characteristics......Page 473
The Position Vector......Page 475
Position Units......Page 476
Automatic Axes Resize......Page 477
Placing Text Outside the Axes......Page 483
Multiple Axes for Different Scaling......Page 484
Individual Axis Control......Page 486
Setting Axis Limits......Page 487
Setting Tick Mark Locations......Page 488
Changing Axis Direction......Page 489
Example — Double Axis Graphs......Page 492
Automatic-Mode Properties......Page 495
Specifying Axes Colors......Page 498
Axes Color Limits — the CLim Property......Page 500
Example — Simulating Multiple Colormaps in a Figure......Page 501
Calculating Color Limits......Page 502
Defining the Color of Lines for Plotting......Page 505
Line Styles Used for Plotting — LineStyleOrder......Page 507
3-D Visualization......Page 509
Creating 3-D Graphs......Page 511
A Typical 3-D Graph......Page 512
Line Plots of 3-D Data......Page 513
Mesh and Surface Plots......Page 515
Visualizing Functions of Two Variables......Page 516
Surface Plots of Nonuniformly Sampled Data......Page 518
Parametric Surfaces......Page 520
Hidden Line Removal......Page 522
Types of Color Data......Page 523
Colormaps......Page 524
Indexed Color Surfaces — Direct and Scaled Colormapping......Page 526
Example — Mapping Surface Curvature to Color......Page 527
Altering Colormaps......Page 529
Truecolor Surfaces......Page 530
Texture Mapping......Page 532
Defining the View......Page 535
Setting the Aspect Ratio......Page 536
Default Views......Page 537
Azimuth and Elevation......Page 538
Defining Scenes with Camera Graphics......Page 542
Camera Toolbar......Page 543
Orbit Camera......Page 546
Orbit Scene Light......Page 547
Pan/Tilt Camera......Page 548
Move Camera Forward and Backward......Page 549
Zoom Camera......Page 551
Camera Roll......Page 552
Camera Graphics Functions......Page 553
Example — Dollying the Camera......Page 554
Graphing the Volume Data......Page 556
Specifying the Light Source......Page 557
Implementing the Fly-Through......Page 558
Low-Level Camera Properties......Page 562
Moving In and Out on the Scene......Page 563
Rotation Without Resizing of Graphics Objects......Page 565
Rotation About the Viewing Axis......Page 566
View Projection Types......Page 568
Projection Types and Camera Location......Page 569
Specifying Axis Scaling......Page 573
Specifying Aspect Ratio......Page 574
Example — axis Command Options......Page 575
Additional Commands for Setting Aspect Ratio......Page 577
Axes Aspect Ratio Properties......Page 578
Default Aspect Ratio Selection......Page 579
Overriding Stretch-to-Fill......Page 581
Effects of Setting Aspect Ratio Properties......Page 582
Example — Displaying Real Objects......Page 586
Lighting as a Visualization Tool......Page 589
Lighting Examples......Page 590
Lighting Commands......Page 591
Light Objects......Page 592
Adding Lights to a Scene......Page 593
Properties That Affect Lighting......Page 596
Face and Edge Lighting Methods......Page 598
Specular and Diffuse Reflection......Page 599
Ambient Light......Page 600
Specular Exponent......Page 601
Back Face Lighting......Page 602
Positioning Lights in Data Space......Page 605
Transparency......Page 607
Making Objects Transparent......Page 608
Specifying Transparency......Page 609
Example — Transparent Isosurface......Page 611
Mapping Data to Transparency — Alpha Data......Page 613
Example — Mapping Data to Color or Transparency......Page 614
Selecting an Alphamap......Page 616
Example — Modifying the Alphamap......Page 618
Creating 3-D Models with Patches......Page 621
Behavior of the patch Function......Page 622
Creating a Single Polygon......Page 624
Example — Defining a Cube......Page 626
Patch Color Properties......Page 631
Example — Specifying Flat Edge and Face Coloring......Page 633
Coloring Edges with Shared Vertices......Page 634
Indexed Color Data......Page 636
Interpolating in Indexed Color Versus Truecolor......Page 639
Volume Visualization Techniques......Page 641
Selecting Visualization Techniques......Page 643
Steps to Create a Volume Visualization......Page 644
Functions for Scalar Data......Page 645
Functions for Vector Data......Page 646
Techniques for Visualizing Scalar Data......Page 647
Example — Ways to Display MRI Data......Page 648
Example — Slicing Fluid Flow Data......Page 654
Modifying the Color Mapping......Page 657
Example — Isosurfaces in Fluid Flow Data......Page 659
Isocaps Add Context to Visualizations......Page 661
Defining Isocaps......Page 662
Example — Adding Isocaps to an Isosurface......Page 663
Using Scalar Techniques with Vector Data......Page 666
Specifying Starting Points for Stream Plots......Page 667
Accessing Subregions of Volume Data......Page 670
Stream Line Plots of Vector Data......Page 672
Displaying Curl with Stream Ribbons......Page 674
Displaying Divergence with Stream Tubes......Page 676
Creating Stream Particle Animations......Page 679
Vector Field Displayed with Cone Plots......Page 682
Index......Page 687