資料文本教程matlab ebooks學習graphics and guis with3rd edition_第1頁
資料文本教程matlab ebooks學習graphics and guis with3rd edition_第2頁
資料文本教程matlab ebooks學習graphics and guis with3rd edition_第3頁
資料文本教程matlab ebooks學習graphics and guis with3rd edition_第4頁
資料文本教程matlab ebooks學習graphics and guis with3rd edition_第5頁
已閱讀5頁,還剩518頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、Graphics and GUIswith®THIRDEDITION© 2003 by Chapman & Hall/CRCGraphics and GUIswith®T H I R DE D I T I O NP A T R I C KM A R C H A N DNVIDIAO .T H O M A SH O L L A N DThe Naval Surface Warfare Center Dahlgren DivisionCHAPMAN & HALL/CRCA CRC Press CompanyLondon New York Washing

2、ton, D.C.© 2003 by Chapman & HBaollc/CaRRCatonThis book contains information obtained from authentic and highly regarded sources. Reprinted material is quoted withpermission, and sources are indicated. A wide variety of references are listed. Reasonable efforts have beento publishreliable d

3、ata and information, but the author and the publisher cannot assume responsibility for the validity of all materials or for the consequences of their use.Neither this book nor any part may be reproduced or transmitted in any form or by any means, electronic or mechanical,including photocopying, micr

4、ofil, and recording, or by any information storage or retrieval system, without priorpermission in writing from the publisher.The consent of CRC Press LLC does not extend to copying for general distribution, for promotion, for creating new works, or for resale. Specific permission must be obtained i

5、n writing from CRC Press LLC for such copying.Direct all inquiries to CRC Press LLC, 2000 N.W. Corporate Blvd., Boca Raton, Florida 33431.Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation, without intent to i

6、nfringe.Visit the CRC Press Web site at© 2003 by Chapman & Hall/CRCNo claim to original U.S. Government works International Standard Book Number 1-58488-320-0 Library of Congress Card Number 2002034769Printed in the United States of America 1 2 3 4 5 6 7 8 9 0Printed on acid-paper© 200

7、3 by Chapman & Hall/CRCLibrary of Congress Cataloging-in-Publication DataMarchand, Patrick.Graphics and GUIs with/ by Patrick Marchand and O. Thomas Holland. 3rd ed.p. cm.Includes bibliographical references and index. ISBN 1-58488-320-01. Computer graphics. 2. Graphical user interfaces (Computer

8、 systems) 3.I. Holland, O. Thomas. II. Title.T385 .M3634 2002006.6¢6dc212002034769PREFACEFirst, I must say that it was quite an honor to be asked to update Patricksseminal work. The original “Graphics and GUIs with” was my, and it was by that bookintroduction to the graphics capabilities ofthat

9、 I came to a working knowledge of handle graphics. That was way backwith4. Now we are at6 (release 13 is in beta release at theis more capable, powerful, and user friendly 4!time of this writing) andthan ever a far cry fromAs with Patricks earliertext, this book is intended to present acompensive di

10、scussion of thegraphics system. This third editionbuilds on the earlier editions by including the objects and properties new toversion 6 and includes the new features of the environment. The organization of this edition is a little different as well. Inteaching, I have observed that not everyone wan

11、ts to be a handlegraphics guru (but they dont know what they are missing!). Many just want tobe able to plot their data quickly and effectively.has addressed thisdesire by expanding, for instance, the Figure Window tools, and providing themore casual user with a tool to modify many figure properties

12、. Consequently, most of the first half of this book requires little or no knowledge of handle graphics. The second half thoroughly covers the concept of handle graphics, and how to create graphical user interfaces.As with the earlier editions, this book has been written to be useful toanyone, regard

13、less of their level of expertise with. If you knownothing aboutprogram, you can learn much by starting at thebeginning and working through the examples in this book. If you are alyconversant with theprogramlanguage, you will find a greatily apparent in thedeal of information here that is notdocument

14、ation. However, I must point out thats documentation hasimproved with the product and you are encouraged tdocumentation but be aware, there is a lot of it!The folks at the MathWorks continue to improveve into the, and itscapabilities have grown well beyond the scope of a single text. New objectshave

15、 been created for the latest versions, and the integrated development environment is more capable and customizable than ever.is a registered trademark ofThe MathWorks Inc.For production information, please contact: The MathWorks, Inc.3 Apple Hill Drive Natick, MA 01760-2098, USAPhone: (508) 647-7000

16、: info© 2003 by Chapman & Hall/CRCThe code in this text is written with version 6 in mind, so some of it will notwork with earlier versions. The code has been written for clarity, not necessarily efficiency, and the functions kept as simple as possible so that you can focus on the graphics

17、aspects. You can download any of the code in this text by going toand following the links for this book. You will also find the solutions to the endof chapter exercises.If you are familiar with the earlier editions, you will see some familiar things here. Good is good and Patrick did such a fine job

18、 that much of what he presented then is still quite applicable and educational. Some things have been dropped, such as Patricks GUI builder. In many respects, modern doesnt need that any more. There are many new ideas in thisedition, along of course with the new functions, features, and properties t

19、hatthe latesthas to offer. Perhaps one of the best aspects ofisthat The MathWorks has continued to develop the product with very littlecompatibility problems. Although there were some major changes from version 4 to version 5 that led to a few problems for some extreme users, the transition from 5 t

20、o 6 has been smooth and has yielded a version that is more user friendly and more capable than ever.So why am I writing this preface instead of Patrick? Patrick is very busy with new challenges in his career that have taken him a little out of theworld, at least as a regular user. My little consulti

21、ng company, Infi Technology Associates, has used his text for some time as a complement toour teachings, and I useposition as director of a mextensively for ming and analysis in mying and simulation facility for the Department ofthe Navy. Through one turn or another, I was contacted about a follow-u

22、p toPatricks second edition. It has been exciting updating and expanding Patricks original work and I know you will find this book a valuable tutorial and resource as you grow in your knowledge and skill of programGraphics and GUIs. However, dont stop with this book. Useasmuch as you can,the abundan

23、ce of documentation that comes with, and by all means experiment. Soon you will wonder how you evergot your work done withoutBest wishes and happy program.!Thomas Holland© 2003 by Chapman & Hall/CRCDEDICATIONThis book is first dedicated to the Creator, who hasminds able to fathom the myster

24、ies of the universe.us with inquisitiveAnd secondly to Linda, Katy, and Danny, the best family I could ever have.I also would like to acknowledge the influence of Wendy Martinez and RonaldGross two GUI gurus with whom it is a pleasure to work with, and of course, Patrick Marchand, who started it all

25、.© 2003 by Chapman & Hall/CRCCONTENTS1 INTRODUCTION1.11.21.3OVERVIEWORGANIZATION OF THIS BOOK TERMINOLOGY AND THEPROGRAMLANGUAGE1.3.11.3.2Getting StartedGetting Help1.4OTHER REFERENCES2 VISUALIZATION CONSIDERATIONS2.12.22.32.42.52.6WHY VISUALIZE?CHARACTERISTICS OF GOOD DATA VISUALIZATIONDAT

26、A QUTY AND DIMENSIONCOLOR, LIGHT, AND SHADINGMOTION INTERACTION3 PLOTTING IN TWO DIMENSIONS3.1SOURCES OF DATA3.1.13.1.2Function DataMeasured Data3.2IMPORTING DATA3.2.13.2.23.2.3Data FormatsImporting High-Level Data Importing Low-Level Data3.3ELEMENTARY 2-D PLOTS3.3.13.3.2A General Overview of the Pl

27、otLogarithmic Plotsd3.4SIMPLE 2-D PLOT MANIPULATION3.4.13.4.23.4.33.4.43.4.53.4.6Generating Plots with Multiple Data SetsUsing Axis to Customize Plots Creating Supporting Text and Legends Text PlacementSpecial Text Character FormatsUsing Subplot to Create Multiple Axes3.5SPECIALIZED 2-D PLOTTING3.5.

28、13.5.23.5.33.5.43.5.53.5.63.5.73.5.8Bar GraphsHistograms Stairstep Graphs Stem PlotsPlots with Error Bars Pie ChartsArea PlotsWorking with Complex Data© 2003 by Chapman & Hall/CRC3.5.93.5.103.5.11Using the Polar Coordinate SystemPlotting Functions with Creating Filled Plots and Shapes3.6PLO

29、T EDITING IN THEFIGURE WINDOW3.6.13.6.23.6.33.6.4Plot Editing ModeThe Property EditorZooand RotatingExporting, Copying, and Pasting3.7ILLUSTRATIVE PROBLEMS4 PLOTTING IN THREE DIMENSIONS4.1ELEMENTARY 3-D PLOTTING4.1.14.1.24.1.34.1.44.1.54.1.64.1.74.1.84.1.94.1.104.1.114.1.124.1.13Using Plot3Creating

30、3-D Meshes and Surfaces Waterfall Plots3-D Plots of Non-Uniformly Sampled Data Creating Shaded Surface PlotsRemoving Hidden Lines Contour PlotsQuiver Plots Combination Plots 3-D Stem PlotsGenerating Surfaces with Triangles Polygons in a 3-D SpaceBuilt-In Surface Functions4.2SIMPLE 3-D PLOT MANIPULAT

31、ION4.2.14.2.24.2.34.2.4The Camera ToolbarGeneralizing the Axis for 3 Dimensions 3-D Plot RotationUsing the Viewd4.3VOLUME VISUALIZATION4.3.14.3.1.14.3.1.24.3.1.34.3.24.3.2.14.3.2.24.3.2.34.3.2.44.3.2.54.3.2.6Scalar Volume DataSlice Planes Contour SlicesIsosurfaces and Isocaps Vector Volume DataStrea

32、m Plots Stream Lines Stream Particles Stream Ribbons Stream Tubes Cone Plots4.44.5A WORD ABOUT ANNOTATING 3-D PLOTSILLUSTRATIVE PROBLEMS5 IMAGE GRAPHICS5.1IMAGE FILES AND FORMATS© 2003 by Chapman & Hall/CRC5.1.1Common Image File Types5.2IMAGE I/O5.2.15.2.25.2.3ing a Graphics ImageDisplaying

33、 a Graphics Image Writing a Graphics Image5.3IMAGE TYPES AND PROPERTIES5.3.15.3.25.3.3Indexed ImagesIntensity Level Images Truecolor Images6 GENERATING OUTPUT6.1THE QUICKEST WAY TO PAPER6.1.1Page Setup6.26.3PRINTING COLORED LINES TO BLACK & WHITE PRINTERSELECTRONIC OUTPUT6.3.16.3.2Using File Exp

34、ortUsing the Windows Clipboard6.4USING THE PRINTDwith PRINT6.4.16.4.26.4.36.4.46.4.56.4.66.4.76.4.8CreatingCreating Graphics Files Using PrintAdding Additional Figures to a File Publishing Using 4-Color Separation EPS with a Preview ImageRendering Method with -zbuffer or -painters Indicating Which F

35、igure Window to Print Saving Figures for Future Use7 HANDLE GRAPHICS7.17.27.3GRAPHICS OBJECTSGRAPHICS OBJECTS HIERARCHY GRAPHICS OBJECTS HANDLES7.3.17.3.2Determining Handles at CreationGetting Handles of Current Objects7.4PROPERTIES7.4.17.4.27.4.37.4.3.17.4.3.27.4.3.37.4.3.47.4.3.57.4.3.67.4.3.77.4.

36、3.87.4.3.9The Property EditorManipulating PropertiesUniversal Object PropertiesButtonDownFcn, BusyAction, and Interruptible Children and ParentClipCreateFCN and DeleteFCN HandleVisibilityHitTestSelected and SelectionHighlight Tag and TypeUserData7.4.3.10Visible© 2003 by Chapman & Hall/CRC7.

37、5OBJECT SPECIFIC PROPERTIES7.5.17.5.1.17.5.1.27.5.1.37.5.27.5.2.17.5.2.27.5.2.37.5.2.47.5.2.57.5.2.67.5.2.77.5.2.87.5.2.9Root PropertiesDisplay Related Root PropertiesRoot Properties Related to the State of Behavior Related Properties of the RootFigure PropertiesFigure Properties Affecting PositionS

38、tyle and Appearance Properties of the Figure Object Figure Properties that Control the ColormapFigure Properties that Affect Transparency Properties that Affect How Figures are Rendered Properties Related to the Current State of a Figure Figure Properties that Affect the PointerFigure Properties tha

39、t Affect Callback Execution Figure Properties that Control Access to Objects7.5.2.10Figure Properties that Affect Printing7.5.37.5.3.17.5.3.27.5.3.37.5.3.47.5.3.57.5.3.67.5.47.5.57.5.67.5.6.17.5.6.27.5.6.37.5.77.5.87.5.9Axes PropertiesAxes Properties Controlling Boxes and Tick Marks Properties Affec

40、ting Axes Character FormatsAxes Properties Determining Axis Location and Position Axes Properties Affecting Grids, Lines, and Color Properties Affecting Axis LimitsAxes Properties Related to Viewing Perspective Line PropertiesRectangle Properties Patch PropertiesProperties Defining Patch ObjectsProp

41、erties Specifying Lines, Color, and Markers Properties Affecting Lighting and TransparencySurface Properties Image Properties Text Properties7.67.77.87.9SETTING DEFAULT PROPERTIESUNDOCUMENTED PROPERTIES USING FINDOBJ ILLUSTRATIVE PROBLEMS8 USING COLOR, LIGHT, AND TRANSPARENCY8.18.2SIMPLE COLOR SPECI

42、FICATIONSCOLOR MAPS8.2.18.2.28.2.2.18.2.2.28.2.38.2.3.18.2.3.28.2.3.38.2.4Effects of Color Maps in GeneralColor Axis ControlColor Control with Direct Map Color Control with Scaled MapColor Maps as they Relate to Graphics Objects Color Maps and the Surface ObjectPatch Objects and the Color Map Images

43、 and the Color MapColor Shading© 2003 by Chapman & Hall/CRC8.2.58.2.68.2.78.2.88.2.98.2.10Brightening and Darkening Color MapsSpinning the Color MapMaking Use of the Invisible Color with NaN Creating Simple Color BarsThe Pseudocolor Plot Texture MapING OBJECT LIGHTINGLight PropertiesFunctio

44、ns that Make Use of Light8.3M8.3.18.3.28.3.2.18.3.38.3.3.18.3.3.28.3.3.38.3.3.48.3.3.58.3.4LightingLighting MdssThe Diffuse Lighting MThe Ambient Lighting M The Specular Lighting M Combining Lighting MsA Final Word on Light ObjectsCreating Color Varying Lines with Surface Objects8.4OBJECT TRANSPAREN

45、CY8.4.18.4.1.18.4.1.28.4.1.38.4.1.48.4.1.58.4.1.68.4.1.78.4.1.88.4.28.4.2.18.4.2.28.4.2.38.4.38.4.4Alpha PropertiesAlphaData Alphamap ALim ALimMode AlphaDataMap FaceAlpha EdgeAlphaFaceVertexAlphaDataAlpha Functionsalpha alphamap alimSetting a Single Transparency ValueMapData to Transparency8.5ILLUST

46、RATIVE PROBLEMS9 ANIMATION9.1FRAME-BY-FRAME CAPTURE AND PLAYBACK9.1.19.1.29.1.39.1.49.1.4.19.1.4.29.1.5Taking a SnapshotPlaying a Movie Preallocating Memory Practically SpeakingRecording the Entire Figure Animating a Portion of the FigureMaking an AVI Movie9.2ON-THE-FLY GRAPHICS OBJECT MANIPULATION9

47、.2.19.2.29.2.39.2.49.2.5Simple Animation FunctionsThe Wrong and Right Way to Animate Graphics The Need for SpeedAnimating Lines Animated Rotations© 2003 by Chapman & Hall/CRC9.2.6Forcing a Graphic to Leave a Trail9.3CHOOSING THE RIGHT TECHNIQUE10 ELEMENTS OF GUI DESIGN10.1WHAT IS AGRAPHICAL

48、 USER INTERFACE?10.2THE THREE PHASES OF INTERFACE DESIGN10.2.110.2.2AnalysisDesign10.2.2.110.2.2.210.2.2.310.2.2.4User ConsiderationsThe Reason for the GUI Cognitive Considerations Physical Considerations10.2.3Paper Prototy10.2.3.1 Appearance10.2.4Construction10.3UI CONTROL ELEMENTS10.3.1The Styles1

49、0.3.1.110.3.1.210.3.1.310.3.1.410.3.1.510.3.1.610.3.1.710.3.1.810.3.1.9Check BoxesEditable Text FramesPop-Up List BoxesPush ButtonssToggle ButtonsRadio Buttons Sliders10.3.1.10 Static Text10.3.2UI Control Properties10.3.2.110.3.2.210.3.2.310.3.2.410.3.2.510.3.2.610.3.2.710.3.2.810.3.2.9Uicontrol Bac

50、kgroundColorUicontrol ButtonDownFcn Uicontrol CDataUicontrol CallBack Uicontrol Enable Uicontrol ExtentUicontrol ForegroundColorUicontrol Font Angle, Name, Size, Units, and Weight Uicontrol HorizontalAlignment10.3.2.10 Uicontrol Min, Max, and Value10.3.2.11 Uicontrol SliderStep10.3.2.12 Uicontrol To

51、oltipString10.3.2.13 Uicontrol Position10.3.2.14 Uicontrol String10.3.2.15 Style10.3.2.16 ListBoxTop10.3.2.17 Uicontrol Units© 2003 by Chapman & Hall/CRC10.3.2.18 Uicontrol Interruptible10.3.2.19 Uicontrol Tag10.3.2.20 Uicontrol UserData10.3.2.21 Uicontrol Visible10.3.2.22 Other UI Control

52、Properties10.3.3Creating Uicontrol Objects10.3.3.110.3.3.210.3.3.310.3.3.410.4UIUicontrol Object LayeringFraObjectsA Stretchable GUIPredefined GUIs and Dialog Boxes ELEMENTSProperties10.4.1Ui10.4.1.110.4.1.210.4.1.310.4.1.410.4.1.510.4.1.610.4.1.710.4.1.810.4.1.9UiUi Ui Ui Ui Ui Ui Ui UiAcceleratorC

53、allBack Checked Children EnableForegroundColor LabelPosition Separator Interruptible Tag UserData Visible10.4.1.10 Ui10.4.1.11 Ui10.4.1.12 Ui10.4.1.13 Ui10.4.1.14 Other UiProperties10.4.2Creating Uis10.4.2.110.4.2.210.4.2.3Top Level UiItems and Sub SummaryTitles10.5LOW-LEVELGUI PROGRAMTECHNIQUES10.5

54、.110.5.2Strings ofProgramStatements and ExpressionsApproaches in10.5.2.110.5.2.210.5.2.310.5.2.4Creating All Graphics Elements in the Base WorkspaceStoring Handles as Global Variables Storing Handles in the UserData PropertiesUtilizing Tags and the FINDOBJd10.6HIGH-LEVEL GUI DEVELOPMENT GUIDE10.6.11

55、0.6.210.6.310.6.410.6.5The Layout EditorThe Property Inspector The Object BrowserTheEditorSaving the GUI10.6.5.1 The GUIDE Created FIG-File10.6.5.2 The GUIDE Created M-File10.6.610.6.7Executing a GUIEditing a Previously Created GUI10.7COMMON PROGRAMDESIRES WITH UI OBJECTS10.7.110.7.210.7.3Creating Exclusive Radio ButtonsLinking Sliders and Editable Text Objects Editable Text and Pop-Up© 2003 by Chapman & Hall/CRC10.7.410.7.51

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論