Graphics and GUIs with MATLAB, (Graphics & GUIs with MATLAB)

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"

MATLAB®, now the industry-standard engineering language for computation, analysis, and visualization, continues to evolve in its capabilities. Version 6.x incorporated several major improvements, including significant enhancements to its graphics features, such as transparencies, increased 3-D visualization, and an improved rendering engine. The bestselling Graphics and GUIs with MATLAB has been fully revised to reflect MATLAB version 6. The third edition also features a number of improvements in both content and organization that ensure its readers get the optimum level of detail and best possible instruction. New in the Third Edition: Full updates that reflect MATLAB 6.x enhancements Expanded discussions on 2-D and 3-D graphics New chapters on good GUI design and data visualization techniques Volume visualizations Updated language commands Deeper coverage of programming techniques, such as data structures and callback techniques Exercises in each chapter Additional examples and updated illustrations

Author(s): Antony Unwin, Martin Theus, Heike Hofmann
Series: Statistics and Computing
Edition: 3
Publisher: Chapman and Hall/CRC
Year: 2002

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

Cover......Page 1
Preface......Page 4
Dedication......Page 6
Contents......Page 7
1.1 Overview......Page 15
1.2 Organization of This Book......Page 16
1.3 Terminology and the MATLAB Programming Language......Page 18
1.3.1 Getting Started......Page 19
1.3.2 Getting Help......Page 20
1.4 Other References......Page 23
2.1 Why Visualize?......Page 24
2.2 Characteristics of Good Data Visualization......Page 25
2.3 Data Quantity and Dimension......Page 26
2.4 Color, Light, and Shading......Page 27
2.6 Interaction......Page 30
3.1.1 Function Data......Page 32
3.1.2 Measured Data......Page 33
3.2.1 MATLAB Data Formats......Page 34
3.2.2 Importing High-Level Data......Page 35
3.2.3 Importing Low-Level Data......Page 37
3.3 Elementary 2-D Plots......Page 38
3.3.1 A General Overview of the Plot Command......Page 39
3.3.2 Logarithmic Plots......Page 48
3.4.1 Generating Plots with Multiple Data Sets......Page 50
3.4.2 Using Axis to Customize Plots......Page 54
3.4.3 Creating Supporting Text and Legends......Page 64
3.4.4 Text Placement......Page 70
3.4.5 Special Text Character Formats......Page 73
3.4.6 Using Subplot to Create Multiple Axes......Page 76
3.5.1 Bar Graphs......Page 80
3.5.2 Histograms......Page 85
3.5.3 Stairstep Graphs......Page 87
3.5.4 Stem Plots......Page 88
3.5.5 Plots with Error Bars......Page 90
3.5.6 Pie Charts......Page 91
3.5.7 Area Plots......Page 96
3.5.8 Working with Complex Data......Page 97
3.5.9 Using the Polar Coordinate System......Page 100
3.5.10 Plotting Functions with MATLAB......Page 104
3.5.11 Creating Filled Plots and Shapes......Page 106
3.6 Plot Editing in the MATLAB Figure Window......Page 108
3.6.1 Plot Editing Mode......Page 109
3.6.2 The Property Editor......Page 110
3.6.3 Zooming and Rotating......Page 111
3.6.4 Exporting, Copying, and Pasting......Page 112
3.7 Illustrative Problems......Page 113
4.1.1 Using Plot3......Page 114
4.1.2 Creating 3-D Meshes and Surfaces......Page 117
4.1.3 Waterfall Plots......Page 122
4.1.4 3-D Plots of Non-Uniformly Sampled Data......Page 123
4.1.5 Creating Shaded Surface Plots......Page 125
4.1.6 Removing Hidden Lines......Page 126
4.1.7 Contour Plots......Page 128
4.1.8 Quiver Plots......Page 134
4.1.9 Combination Plots......Page 135
4.1.10 3-D Stem Plots......Page 140
4.1.11 Generating Surfaces with Triangles......Page 142
4.1.12 Polygons in a 3-D Space......Page 144
4.1.13 Built-In Surface Functions......Page 145
4.2.1 The Camera Toolbar......Page 149
4.2.2 Generalizing the Axis for 3 Dimensions......Page 151
4.2.3 3-D Plot Rotation......Page 153
4.2.4 Using the View Command......Page 155
4.3.1 Scalar Volume Data......Page 158
4.3.1.1 Slice Planes......Page 160
4.3.1.2 Contour Slices......Page 162
4.3.1.3 Isosurfaces and Isocaps......Page 164
4.3.2 Vector Volume Data......Page 166
4.3.2.1 Stream Plots......Page 169
4.3.2.2 Stream Lines......Page 170
4.3.2.3 Stream Particles......Page 172
4.3.2.4 Stream Ribbons......Page 173
4.3.2.5 Stream Tubes......Page 174
4.3.2.6 Cone Plots......Page 175
4.4 A Word About Annotating 3-D Plots......Page 177
4.5 Illustrative Problems......Page 178
5.1 Image Files and Formats......Page 179
5.1.1 Common Image File Types......Page 180
5.2 Image I/O......Page 182
5.2.1 Reading a Graphics Image......Page 184
5.2.2 Displaying a Graphics Image......Page 185
5.2.3 Writing a Graphics Image......Page 187
5.3.1 Indexed Images......Page 188
5.3.2 Intensity Level Images......Page 190
5.3.3 Truecolor Images......Page 193
6.1 The Quickest Way to Paper......Page 195
6.1.1 Page Setup......Page 196
6.2 Printing Colored Lines to Black & White Printers......Page 197
6.3.2 Using the Windows Clipboard......Page 198
6.4.2 Creating Graphics Files Using Print......Page 199
6.4.5 EPS with a Preview Image......Page 200
6.4.7 Indicating Which Figure Window to Print......Page 201
6.4.8 Saving Figures for Future Use......Page 202
7.1 Graphics Objects......Page 203
7.2 Graphics Objects Hierarchy......Page 205
7.3 Graphics Objects Handles......Page 210
7.3.1 Determining Handles at Creation......Page 211
7.3.2 Getting Handles of Current Objects......Page 212
7.4 Properties......Page 214
7.4.1 The Property Editor......Page 215
7.4.2 Manipulating Properties......Page 216
7.4.3 Universal Object Properties......Page 218
7.4.3.1 ButtonDownFcn, BusyAction, and Interruptible......Page 219
7.4.3.3 Clipping......Page 220
7.4.3.4 CreateFcn and DeleteFcn......Page 222
7.4.3.5 HandleVisibility......Page 223
7.4.3.7 Selected and SelectionHighlight......Page 224
7.4.3.8 Tag and Type......Page 225
7.5 Object Specific Properties......Page 226
7.5.1 Root Properties......Page 227
7.5.1.1 Display Related Root Properties......Page 228
7.5.1.2 Root Properties Related to the State of MATLAB......Page 229
7.5.1.3 Behavior Related Properties of the Root......Page 231
7.5.2 Figure Properties......Page 232
7.5.2.1 Figure Properties Affecting Position......Page 234
7.5.2.2 Style and Appearance Properties of the Figure Object......Page 235
7.5.2.3 Figure Properties that Control the Colormap......Page 236
7.5.2.5 Properties that Affect How Figures are Rendered......Page 237
7.5.2.6 Properties Related to the Current State of a Figure......Page 238
7.5.2.7 Figure Properties that Affect the Pointer......Page 241
7.5.2.8 Figure Properties that Affect Callback Execution......Page 242
7.5.2.9 Figure Properties that Control Access to Objects......Page 246
7.5.2.10 Figure Properties that Affect Printing......Page 247
7.5.3 Axes Properties......Page 248
7.5.3.1 Axes Properties Controlling Boxes and Tick Marks......Page 250
7.5.3.3 Axes Properties Determining Axis Location and Position......Page 257
7.5.3.4 Axes Properties Affecting Grids, Lines, and Color......Page 260
7.5.3.5 Properties Affecting Axis Limits......Page 268
7.5.3.6 Axes Properties Related to Viewing Perspective......Page 277
7.5.4 Line Properties......Page 278
7.5.5 Rectangle Properties......Page 284
7.5.6 Patch Properties......Page 285
7.5.6.1 Properties Defining Patch Objects......Page 287
7.5.6.2 Properties Specifying Lines, Color, and Markers......Page 289
7.5.6.3 Properties Affecting Lighting and Transparency......Page 292
7.5.7 Surface Properties......Page 293
7.5.8 Image Properties......Page 299
7.5.9 Text Properties......Page 301
7.6 Setting Default Properties......Page 307
7.7 Undocumented Properties......Page 308
7.8 Using FINDOBJ......Page 309
7.9 IlIustrative Problems......Page 312
8.2 Color Maps......Page 313
8.2.1 Effects of Color Maps in General......Page 316
8.2.2.1 Color Control with Direct Mapping......Page 317
8.2.2.2 Color Control with Scaled Mapping......Page 318
8.2.3.1 Color Maps and the Surface Object......Page 319
8.2.3.2 Patch Objects and the Color Map......Page 325
8.2.3.3 Images and the Color Map......Page 327
8.2.5 Brightening and Darkening Color Maps......Page 331
8.2.6 Spinning the Color Map......Page 334
8.2.7 Making Use of the Invisible Color with NaN......Page 335
8.2.8 Creating Simple Color Bars......Page 340
8.2.9 The Pseudocolor Plot......Page 341
8.2.10 Texture Mapping......Page 346
8.3.1 Light Properties......Page 350
8.3.2 Functions that Make Use of Light......Page 351
8.3.2.1 Lighting Commands......Page 355
8.3.3.1 The Diffuse Lighting Model......Page 356
8.3.3.2 The Ambient Lighting Model......Page 358
8.3.3.3 The Specular Lighting Model......Page 359
8.3.3.4 Combining Lighting Models......Page 361
8.3.4 Creating Color Varying Lines with Surface Objects......Page 362
8.4.1 Alpha Properties......Page 364
8.4.1.4 ALimMode......Page 365
8.4.1.8 FaceVertexAlphaData......Page 366
8.4.2.2 alphamap......Page 367
8.4.2.3 alim......Page 368
8.4.4 Mapping Data to Transparency......Page 369
8.5 Illustrative Problems......Page 371
9.1 Frame-by-Frame Capture and Playback......Page 372
9.1.1 Taking a Snapshot......Page 374
9.1.2 Playing a Movie......Page 377
9.1.3 Preallocating Memory......Page 378
9.1.4.1 Recording the Entire Figure......Page 379
9.1.4.2 Animating a Portion of the Figure......Page 380
9.1.5 Making an AVI Movie......Page 382
9.2.1 Simple Animation Functions......Page 383
9.2.2 The Wrong and Right Way to Animate Graphics......Page 384
9.2.4 Animating Lines......Page 387
9.2.5 Animated Rotations......Page 388
9.2.6 Forcing a Graphic to Leave a Trail......Page 393
9.3 Choosing the Right Technique......Page 394
10.1 What is a MATLAB Graphical User Interface?......Page 396
10.2 The Three Phases of Interface Design......Page 397
10.2.2.2 The Reason for the GUI......Page 398
10.2.2.3 Cognitive Considerations......Page 399
10.2.3.1 Appearance......Page 400
10.2.4 Construction......Page 401
10.3.1.1 Check Boxes......Page 402
10.3.1.2 Editable Text......Page 403
10.3.1.3 Frames......Page 404
10.3.1.4 Pop-Up Menus......Page 405
10.3.1.6 Push Buttons......Page 406
10.3.1.8 Radio Buttons......Page 407
10.3.1.9 Sliders......Page 408
10.3.2 UI Control Properties......Page 409
10.3.2.4 Uicontrol CallBack......Page 411
10.3.2.5 Uicontrol Enable......Page 412
10.3.2.8 Uicontrol Font Angle, Name, Size, Units, and Weight......Page 413
10.3.2.9 Uicontrol HorizontalAlignment......Page 414
10.3.2.11 Uicontrol SliderStep......Page 415
10.3.2.13 Uicontrol Position......Page 416
10.3.2.15 Style......Page 417
10.3.2.16 ListBoxTop......Page 418
10.3.2.20 Uicontrol UserData......Page 419
10.3.3 Creating Uicontrol Objects......Page 420
10.3.3.1 Uicontrol Object Layering......Page 421
10.3.3.2 Framing Objects......Page 422
10.3.3.3 A Stretchable GUI......Page 423
10.3.3.4 Predefined GUIs and Dialog Boxes......Page 425
10.4 Uimenu Elements......Page 432
10.4.1 Uimenu Properties......Page 433
10.4.1.1 Uimenu Accelerator......Page 434
10.4.1.3 Uimenu Checked......Page 435
10.4.1.4 Uimenu Children......Page 436
10.4.1.7 Uimenu Label......Page 437
10.4.1.9 Uimenu Separator......Page 438
10.4.1.12 Uimenu UserData......Page 439
10.4.2.1 Top Level Uimenu......Page 440
10.4.2.2 Menu Items and Submenu Titles......Page 441
10.4.2.3 Summary......Page 442
10.5.1 Strings of MATLAB Statements and Expressions......Page 444
10.5.2 Programming Approaches in MATLAB......Page 446
10.5.2.1 Creating All Graphics Elements in the Base Workspace......Page 447
10.5.2.2 Storing Handles as Global Variables......Page 452
10.5.2.3 Storing Handles in the UserData Properties......Page 456
10.5.2.4 Utilizing Tags and the FINDOBJ Command......Page 459
10.6 High-Level GUI Development – GUIDE......Page 461
10.6.1 The Layout Editor......Page 462
10.6.2 The Property Inspector......Page 463
10.6.3 The Object Browser......Page 465
10.6.5.1 The GUIDE Created FIG-File......Page 466
10.6.5.2 The GUIDE Created M-File......Page 467
10.6.6 Executing a GUI......Page 470
10.6.7 Editing a Previously Created GUI......Page 471
10.7 Common Programming Desires with UI Objects......Page 472
10.7.1 Creating Exclusive Radio Buttons......Page 473
10.7.2 Linking Sliders and Editable Text Objects......Page 475
10.7.3 Editable Text and Pop-Up Menu......Page 477
10.7.4 Windowed Frame and Interruptions......Page 479
10.7.5 Toggling Menu Labels......Page 482
10.7.6 Customizing a Button with Graphics......Page 483
10.8.1 Event Scheduling and Execution......Page 485
10.8.2 Execution Order of Events......Page 486
10.8.2.1 Mouse Button Pressed Down......Page 487
10.8.2.3 Mouse Pointer Moved......Page 488
10.8.3 Interruptible vs. Uninterruptible......Page 489
10.8.4.1 Moving Objects with the Mouse......Page 490
10.8.4.2 Dynamic Boxes Using the RBBOX Function......Page 494
10.9 Creating Custom User Interface Components......Page 495
10.9.1 Simulating Buttons with Image Objects......Page 496
10.9.2 Creating a Dial......Page 500
Bibliographic References......Page 504
MATLAB Data Formats – Section 3.2.1......Page 505
Line Color, Marker Style, and Line Style Strings – Section 3.3.1......Page 506
TeX Characters Available in MATLAB – Section 3.4.5......Page 507
Projection Types – Section 4.2.1......Page 508
Summary of the Axis Function – Section 4.2.2......Page 509
Scalar Volume Computation Functions – Section 4.3.1......Page 510
Graphics Objects Creation Functions – Section 7.1......Page 511
Root Properties – Section 7.5.1......Page 512
Figure Properties – Section 7.5.2......Page 513
Axis Properties – Section 7.5.3......Page 515
Rectangle Properties – Section 7.5.5......Page 517
Patch Properties – Section 7.5.6......Page 518
Surface Properties – Section 7.5.7......Page 519
Text Properties – Section 7.5.9......Page 520
Alpha Properties – Section 8.4.1......Page 521
Uicontrol Properties – Section 10.3.2......Page 522
Uimenu Properties – Section 10.4.1......Page 523