Graphics

Examples


Use this example index to jump to code examples in the documentation.

Plotting Tools

Example -- Working with Plotting Tools
Example -- Plotting Workspace Variables
Example -- Specifying a Data Source

Generating M-Code

Example -- Generating M-Code to Reproduce a Graph

Data Statistics

Example -- Plotting the Mean of a Data Set

Aligning Objects

Example -- Vertical Distribute, Horizontal Align
Example -- Aligning Text

Interactive Text Placement

Example -- Aligning Text

Greek Letters and Mathematical Symbols

Example -- Using a Mathematical Expression to Title a Graph

Multiline Text

Example -- Multiline Text

Creating Specialized Plots

Grouped Bar Graph
Detached 3-D Bars
Grouped 3-D Bars
Stacked Bar Graphs to Show Contributing Amounts
Overlaying Plots on Bar Graphs
Comparing Data Sets with Area Graphs
Example -- Pie Chart
Two-Dimensional Stem Plots
Combining Stem Plots with Line Plots
3-D Stem Plot of an FFT
Example -- Combining Stem and Line Plots
Example -- Stairstep Plot of a Function
Example -- Compass Plot of Wind Direction and Speed
Contour Plot of the Peaks Function
Displaying Contours in Polar Coordinates
Example -- Selecting Plotting Points from the Screen
Example -- Visualizing an FFT as a Movie
Example -- Animating with Erase Modes

Basic Printing and Exporting

Printing a Figure at Screen Size
Printing with a Specific Paper Size
Printing a Centered Figure
Exporting in a Specific Graphics Format
Exporting in EPS Format with a TIFF Preview
Exporting a Figure to the Clipboard

Handle Graphics Objects

Example -- Creating Core Graphics Objects
Examples -- Setting Default Line Styles
Example -- Copying Objects
Example -- Using newplot

Plot Objects

Creating a Plot Object

Plot Objects

Data Source Example

Annotation Objects

Example -- Enclosing Subplots with an Annotation Rectangle

Group Objects

Rotations Away From the Origin
Example -- Transforming a Hierarchy of Objects
Example -- Translating Grouped Objects

Finding Object Handles

Example -- Finding Objects
Example -- Using Logical Operators and Regular Expression

Testing for Hold State

Testing for Hold State

Container Objects

Example -- Using Figure Panels

Function Handle Callbacks

Example -- Using Function Handles in GUIs

Figure Properties

Example -- Specifying Figure Position
Example -- Two Custom Pointers

Axes Properties

Creating Axes with Specific Characteristics
Placing Text Outside the Axes
Multiple Axes for Different Scaling
Setting Tick Mark Locations
Changing Axis Direction
Example -- Double Axis Graphs
Calculating Color Limits