Graphics and GUIs with MATLAB, Third Edition

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): O. Thomas Holland, Patrick Marchand
Edition: 3
Publisher: Chapman and Hall\/CRC
Year: 2002

Language: English
Commentary: complete, with m files attached in pdf's cover page
Pages: 525

GRAPHICS AND GUIS WITH MATLAB, 3RD ED.......Page 1
Half-title......Page 2
Title Page......Page 3
Copyright Page......Page 4
Preface......Page 5
Dedication......Page 7
Contents......Page 8
1.1 Overview......Page 16
1.2 Organization of This Book......Page 17
1.3 Terminology and the MATLAB Programming Language......Page 19
1.3.1 Getting Started......Page 20
1.3.2 Getting Help......Page 21
1.4 Other References......Page 24
2.1 Why Visualize?......Page 25
2.2 Characteristics of Good Data Visualization......Page 26
2.3 Data Quantity and Dimension......Page 27
2.4 Color, Light, and Shading......Page 28
2.6 Interaction......Page 31
3.1.1 Function Data......Page 33
3.1.2 Measured Data......Page 34
3.2.1 MATLAB Data Formats......Page 35
3.2.2 Importing High-Level Data......Page 36
3.2.3 Importing Low-Level Data......Page 38
3.3 Elementary 2-D Plots......Page 39
3.3.1 A General Overview of the Plot Command......Page 40
3.3.2 Logarithmic Plots......Page 49
3.4.1 Generating Plots with Multiple Data Sets......Page 51
3.4.2 Using Axis to Customize Plots......Page 55
3.4.3 Creating Supporting Text and Legends......Page 65
3.4.4 Text Placement......Page 71
3.4.5 Special Text Character Formats......Page 74
3.4.6 Using Subplot to Create Multiple Axes......Page 77
3.5.1 Bar Graphs......Page 81
3.5.2 Histograms......Page 86
3.5.3 Stairstep Graphs......Page 88
3.5.4 Stem Plots......Page 89
3.5.5 Plots with Error Bars......Page 91
3.5.6 Pie Charts......Page 92
3.5.7 Area Plots......Page 97
3.5.8 Working with Complex Data......Page 98
3.5.9 Using the Polar Coordinate System......Page 101
3.5.10 Plotting Functions with MATLAB......Page 105
3.5.11 Creating Filled Plots and Shapes......Page 107
3.6 Plot Editing in the MATLAB Figure Window......Page 109
3.6.1 Plot Editing Mode......Page 110
3.6.2 The Property Editor......Page 111
3.6.3 Zooming and Rotating......Page 112
3.6.4 Exporting, Copying, and Pasting......Page 113
3.7 Illustrative Problems......Page 114
4.1.1 Using Plot3......Page 115
4.1.2 Creating 3-D Meshes and Surfaces......Page 118
4.1.3 Waterfall Plots......Page 123
4.1.4 3-D Plots of Non-Uniformly Sampled Data......Page 124
4.1.5 Creating Shaded Surface Plots......Page 126
4.1.6 Removing Hidden Lines......Page 127
4.1.7 Contour Plots......Page 129
4.1.8 Quiver Plots......Page 135
4.1.9 Combination Plots......Page 136
4.1.10 3-D Stem Plots......Page 141
4.1.11 Generating Surfaces with Triangles......Page 143
4.1.12 Polygons in a 3-D Space......Page 145
4.1.13 Built-In Surface Functions......Page 146
4.2.1 The Camera Toolbar......Page 150
4.2.2 Generalizing the Axis for 3 Dimensions......Page 152
4.2.3 3-D Plot Rotation......Page 154
4.2.4 Using the View Command......Page 156
4.3.1 Scalar Volume Data......Page 159
4.3.1.1 Slice Planes......Page 161
4.3.1.2 Contour Slices......Page 163
4.3.1.3 Isosurfaces and Isocaps......Page 165
4.3.2 Vector Volume Data......Page 167
4.3.2.1 Stream Plots......Page 170
4.3.2.2 Stream Lines......Page 171
4.3.2.3 Stream Particles......Page 173
4.3.2.4 Stream Ribbons......Page 174
4.3.2.5 Stream Tubes......Page 175
4.3.2.6 Cone Plots......Page 176
4.4 A Word About Annotating 3-D Plots......Page 178
4.5 Illustrative Problems......Page 179
5.1 Image Files and Formats......Page 180
5.1.1 Common Image File Types......Page 181
5.2 Image I/O......Page 183
5.2.1 Reading a Graphics Image......Page 185
5.2.2 Displaying a Graphics Image......Page 186
5.2.3 Writing a Graphics Image......Page 188
5.3.1 Indexed Images......Page 189
5.3.2 Intensity Level Images......Page 191
5.3.3 Truecolor Images......Page 194
6.1 The Quickest Way to Paper......Page 196
6.1.1 Page Setup......Page 197
6.2 Printing Colored Lines to Black & White Printers......Page 198
6.3.2 Using the Windows Clipboard......Page 199
6.4.2 Creating Graphics Files Using Print......Page 200
6.4.5 EPS with a Preview Image......Page 201
6.4.7 Indicating Which Figure Window to Print......Page 202
6.4.8 Saving Figures for Future Use......Page 203
7.1 Graphics Objects......Page 204
7.2 Graphics Objects Hierarchy......Page 206
7.3 Graphics Objects Handles......Page 211
7.3.1 Determining Handles at Creation......Page 212
7.3.2 Getting Handles of Current Objects......Page 213
7.4 Properties......Page 215
7.4.1 The Property Editor......Page 216
7.4.2 Manipulating Properties......Page 217
7.4.3 Universal Object Properties......Page 219
7.4.3.1 ButtonDownFcn, BusyAction, and Interruptible......Page 220
7.4.3.3 Clipping......Page 221
7.4.3.4 CreateFcn and DeleteFcn......Page 223
7.4.3.5 HandleVisibility......Page 224
7.4.3.7 Selected and SelectionHighlight......Page 225
7.4.3.8 Tag and Type......Page 226
7.5 Object Specific Properties......Page 227
7.5.1 Root Properties......Page 228
7.5.1.1 Display Related Root Properties......Page 229
7.5.1.2 Root Properties Related to the State of MATLAB......Page 230
7.5.1.3 Behavior Related Properties of the Root......Page 232
7.5.2 Figure Properties......Page 233
7.5.2.1 Figure Properties Affecting Position......Page 235
7.5.2.2 Style and Appearance Properties of the Figure Object......Page 236
7.5.2.3 Figure Properties that Control the Colormap......Page 237
7.5.2.5 Properties that Affect How Figures are Rendered......Page 238
7.5.2.6 Properties Related to the Current State of a Figure......Page 239
7.5.2.7 Figure Properties that Affect the Pointer......Page 242
7.5.2.8 Figure Properties that Affect Callback Execution......Page 243
7.5.2.9 Figure Properties that Control Access to Objects......Page 247
7.5.2.10 Figure Properties that Affect Printing......Page 248
7.5.3 Axes Properties......Page 249
7.5.3.1 Axes Properties Controlling Boxes and Tick Marks......Page 251
7.5.3.3 Axes Properties Determining Axis Location and Position......Page 258
7.5.3.4 Axes Properties Affecting Grids, Lines, and Color......Page 261
7.5.3.5 Properties Affecting Axis Limits......Page 269
7.5.3.6 Axes Properties Related to Viewing Perspective......Page 278
7.5.4 Line Properties......Page 279
7.5.5 Rectangle Properties......Page 285
7.5.6 Patch Properties......Page 286
7.5.6.1 Properties Defining Patch Objects......Page 288
7.5.6.2 Properties Specifying Lines, Color, and Markers......Page 290
7.5.6.3 Properties Affecting Lighting and Transparency......Page 293
7.5.7 Surface Properties......Page 294
7.5.8 Image Properties......Page 300
7.5.9 Text Properties......Page 302
7.6 Setting Default Properties......Page 308
7.7 Undocumented Properties......Page 309
7.8 Using FINDOBJ......Page 310
7.9 IlIustrative Problems......Page 313
8.2 Color Maps......Page 314
8.2.1 Effects of Color Maps in General......Page 317
8.2.2.1 Color Control with Direct Mapping......Page 318
8.2.2.2 Color Control with Scaled Mapping......Page 319
8.2.3.1 Color Maps and the Surface Object......Page 320
8.2.3.2 Patch Objects and the Color Map......Page 326
8.2.3.3 Images and the Color Map......Page 328
8.2.5 Brightening and Darkening Color Maps......Page 332
8.2.6 Spinning the Color Map......Page 335
8.2.7 Making Use of the Invisible Color with NaN......Page 336
8.2.8 Creating Simple Color Bars......Page 341
8.2.9 The Pseudocolor Plot......Page 342
8.2.10 Texture Mapping......Page 347
8.3.1 Light Properties......Page 351
8.3.2 Functions that Make Use of Light......Page 352
8.3.2.1 Lighting Commands......Page 356
8.3.3.1 The Diffuse Lighting Model......Page 357
8.3.3.2 The Ambient Lighting Model......Page 359
8.3.3.3 The Specular Lighting Model......Page 360
8.3.3.4 Combining Lighting Models......Page 362
8.3.4 Creating Color Varying Lines with Surface Objects......Page 363
8.4.1 Alpha Properties......Page 365
8.4.1.4 ALimMode......Page 366
8.4.1.8 FaceVertexAlphaData......Page 367
8.4.2.2 alphamap......Page 368
8.4.2.3 alim......Page 369
8.4.4 Mapping Data to Transparency......Page 370
8.5 Illustrative Problems......Page 372
9.1 Frame-by-Frame Capture and Playback......Page 373
9.1.1 Taking a Snapshot......Page 375
9.1.2 Playing a Movie......Page 378
9.1.3 Preallocating Memory......Page 379
9.1.4.1 Recording the Entire Figure......Page 380
9.1.4.2 Animating a Portion of the Figure......Page 381
9.1.5 Making an AVI Movie......Page 383
9.2.1 Simple Animation Functions......Page 384
9.2.2 The Wrong and Right Way to Animate Graphics......Page 385
9.2.4 Animating Lines......Page 388
9.2.5 Animated Rotations......Page 389
9.2.6 Forcing a Graphic to Leave a Trail......Page 394
9.3 Choosing the Right Technique......Page 395
10.1 What is a MATLAB Graphical User Interface?......Page 397
10.2 The Three Phases of Interface Design......Page 398
10.2.2.2 The Reason for the GUI......Page 399
10.2.2.3 Cognitive Considerations......Page 400
10.2.3.1 Appearance......Page 401
10.2.4 Construction......Page 402
10.3.1.1 Check Boxes......Page 403
10.3.1.2 Editable Text......Page 404
10.3.1.3 Frames......Page 405
10.3.1.4 Pop-Up Menus......Page 406
10.3.1.6 Push Buttons......Page 407
10.3.1.8 Radio Buttons......Page 408
10.3.1.9 Sliders......Page 409
10.3.2 UI Control Properties......Page 410
10.3.2.4 Uicontrol CallBack......Page 412
10.3.2.5 Uicontrol Enable......Page 413
10.3.2.8 Uicontrol Font Angle, Name, Size, Units, and Weight......Page 414
10.3.2.9 Uicontrol HorizontalAlignment......Page 415
10.3.2.11 Uicontrol SliderStep......Page 416
10.3.2.13 Uicontrol Position......Page 417
10.3.2.15 Style......Page 418
10.3.2.16 ListBoxTop......Page 419
10.3.2.20 Uicontrol UserData......Page 420
10.3.3 Creating Uicontrol Objects......Page 421
10.3.3.1 Uicontrol Object Layering......Page 422
10.3.3.2 Framing Objects......Page 423
10.3.3.3 A Stretchable GUI......Page 424
10.3.3.4 Predefined GUIs and Dialog Boxes......Page 426
10.4 Uimenu Elements......Page 433
10.4.1 Uimenu Properties......Page 434
10.4.1.1 Uimenu Accelerator......Page 435
10.4.1.3 Uimenu Checked......Page 436
10.4.1.4 Uimenu Children......Page 437
10.4.1.7 Uimenu Label......Page 438
10.4.1.9 Uimenu Separator......Page 439
10.4.1.12 Uimenu UserData......Page 440
10.4.2.1 Top Level Uimenu......Page 441
10.4.2.2 Menu Items and Submenu Titles......Page 442
10.4.2.3 Summary......Page 443
10.5.1 Strings of MATLAB Statements and Expressions......Page 445
10.5.2 Programming Approaches in MATLAB......Page 447
10.5.2.1 Creating All Graphics Elements in the Base Workspace......Page 448
10.5.2.2 Storing Handles as Global Variables......Page 453
10.5.2.3 Storing Handles in the UserData Properties......Page 457
10.5.2.4 Utilizing Tags and the FINDOBJ Command......Page 460
10.6 High-Level GUI Development – GUIDE......Page 462
10.6.1 The Layout Editor......Page 463
10.6.2 The Property Inspector......Page 464
10.6.3 The Object Browser......Page 466
10.6.5.1 The GUIDE Created FIG-File......Page 467
10.6.5.2 The GUIDE Created M-File......Page 468
10.6.6 Executing a GUI......Page 471
10.6.7 Editing a Previously Created GUI......Page 472
10.7 Common Programming Desires with UI Objects......Page 473
10.7.1 Creating Exclusive Radio Buttons......Page 474
10.7.2 Linking Sliders and Editable Text Objects......Page 476
10.7.3 Editable Text and Pop-Up Menu......Page 478
10.7.4 Windowed Frame and Interruptions......Page 480
10.7.5 Toggling Menu Labels......Page 483
10.7.6 Customizing a Button with Graphics......Page 484
10.8.1 Event Scheduling and Execution......Page 486
10.8.2 Execution Order of Events......Page 487
10.8.2.1 Mouse Button Pressed Down......Page 488
10.8.2.3 Mouse Pointer Moved......Page 489
10.8.3 Interruptible vs. Uninterruptible......Page 490
10.8.4.1 Moving Objects with the Mouse......Page 491
10.8.4.2 Dynamic Boxes Using the RBBOX Function......Page 495
10.9 Creating Custom User Interface Components......Page 496
10.9.1 Simulating Buttons with Image Objects......Page 497
10.9.2 Creating a Dial......Page 501
Bibliographic References......Page 505
MATLAB Data Formats – Section 3.2.1......Page 506
Line Color, Marker Style, and Line Style Strings – Section 3.3.1......Page 507
TeX Characters Available in MATLAB – Section 3.4.5......Page 508
Projection Types – Section 4.2.1......Page 509
Summary of the Axis Function – Section 4.2.2......Page 510
Scalar Volume Computation Functions – Section 4.3.1......Page 511
Graphics Objects Creation Functions – Section 7.1......Page 512
Root Properties – Section 7.5.1......Page 513
Figure Properties – Section 7.5.2......Page 514
Axis Properties – Section 7.5.3......Page 516
Rectangle Properties – Section 7.5.5......Page 518
Patch Properties – Section 7.5.6......Page 519
Surface Properties – Section 7.5.7......Page 520
Text Properties – Section 7.5.9......Page 521
Alpha Properties – Section 8.4.1......Page 522
Uicontrol Properties – Section 10.3.2......Page 523
Uimenu Properties – Section 10.4.1......Page 524
Back Cover......Page 525