Danh mục

Lecture note Data visualization - Chapter 24

Số trang: 35      Loại file: pptx      Dung lượng: 3.22 MB      Lượt xem: 2      Lượt tải: 0    
10.10.2023

Phí tải xuống: 13,000 VND Tải xuống file đầy đủ (35 trang) 0
Xem trước 4 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

The main contents of the chapter consist of the following: Plots with more than one line, plots of complex arrays, line, color and mark style, axis scaling and annotating plots, subplots, polar plots, logarithmic plots, bar graphs and pie charts, histograms, X-Y graphs with two Y-axes.
Nội dung trích xuất từ tài liệu:
Lecture note Data visualization - Chapter 24Lecture24RecapPlotswithMorethanoneLinePlotsofComplexArraysLine,ColorandMarkStyleAxisScalingandAnnotatingPlotsSubplotsPolarPlotsLogarithmicPlotsBarGraphsandPieChartsFunctionPlotsThreeDimensionalLinePlotsTheplot3functionissimilartotheplotfunction,except thatitacceptsdatainthreedimensionsInsteadofjustprovidingxandyvectors,theusermust alsoprovideazvectorTheseorderedtriplesarethenplottedinthreespaceand connectedwithstraightlinesForexample: clear,clc x=linspace(0,10*pi,1000); y=cos(x);SurfacePlotsSurfaceplotsallowtorepresentdataasasurfaceTwotypesofsurfaceplots Meshplots SurfplotsMeshPlotsThereareseveralwaystousemeshplotsTheycanbeusedtogoodeffectwithasingletwo dimensionalmxnmatrixInthisapplication,thevalueinthematrixrepresentsthe zvalueintheplotThexandyvaluesarebasedonthematrixdimensions Take,forexample,thefollowingverysimplematrix: z=[1,2,3,4,5,6,7,8,9,10; 2,4,6,8,10,12,14,16,18,20; 3,4,5,6,7,8,9,10,11,12];ExplanationofGraphThegraphisa“mesh”createdbyconnectingthepoints definedinzintoarectilineargridNoticethatthexaxisgoesfrom0to10andygoesfrom 1to3ThematrixindexnumberswereusedfortheaxisvaluesMeshPlotsContinued….Themeshfunctioncanalsobeusedwiththreearguments: mesh(x,y,z)Inthiscase,xisalistofxcoordinates,yisalistofy coordinates,andzisalistofzcoordinates. x=linspace(1,50,10) y=linspace(500,1000,3) z=[1,2,3,4,5,6,7,8,9,10; 2,4,6,8,10,12,14,16,18,20; 3,4,5,6,7,8,9,10,11,12]SurfPlotsSurfplotsaresimilartomeshplots,butsurfcreatesa threedimensionalcoloredsurfaceinsteadofameshThecolorsvarywiththevalueofzThesurfcommandtakesthesameinputasmesh:eithera singleinput—Forexample:surf(z),inwhichcaseitusestherowand columnindicesasx–andycoordinates—orthree matricesThecommand surf(x,y,z)Continued….Theshadingschemeforsurfaceplotsiscontrolledwith theshadingcommandThedefault(showninpreviousslide)is“faceted.”InterpolatedshadingcancreateinterestingeffectsTheplot(innextslide)iscreatedbyadding shadinginterp tothepreviouslistofcommandsContinued….Flatshadingwithoutthegridisgeneratedwhen shadingflat isusedContinued….Thecolorschemeusedinsurfaceplotscanbecontrolled withthecolormapfunctionForexample: colormap(gray) forcesagrayscalerepresentationforsurfaceplotsThismaybeappropriateifyou’llbemakingblackand whitecopiesofyourplotsOtheravailablecolormapsare autumn bone hot spring colorcube hsvExampleAmorecomplicatedsurfacecanbecreatedbycalculating thevaluesofZ: x=[2:0.2:2]; y=[2:0.2:2]; [X,Y]=meshgrid(x,y); Z=X.*exp(X.^2Y.^2);Intheprecedingcode,themeshgridfunctionisusedto createthetwodimensionalmatricesXandYfromthe onedimensionalvectorsxandyThevaluesinZarethencalculated

Tài liệu được xem nhiều: