0% found this document useful (0 votes)
47 views

Frankkweb Word Format Matlab

This document provides instructions for formatting Matlab graphs. It explains how to: 1) Scale the axes to tightly frame the data and remove unnecessary grids or space 2) Adjust the legend by selecting, dragging to an empty space, and editing the text descriptions 3) Format the different data lines and models by selecting them individually and adjusting properties like color, line width, and dash patterns to clearly distinguish each line or data point set. The formatted graph can then be copied or exported for use in other documents.

Uploaded by

Omair Mir
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

Frankkweb Word Format Matlab

This document provides instructions for formatting Matlab graphs. It explains how to: 1) Scale the axes to tightly frame the data and remove unnecessary grids or space 2) Adjust the legend by selecting, dragging to an empty space, and editing the text descriptions 3) Format the different data lines and models by selecting them individually and adjusting properties like color, line width, and dash patterns to clearly distinguish each line or data point set. The formatted graph can then be copied or exported for use in other documents.

Uploaded by

Omair Mir
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

How to Format a Matlab Graph Jeffrey Donell The Woodruff School of Mechanical Engineering

HOW FORMAT A MATLAB GRAPH

Jeffrey Donnell The George W. Woodruff School of Mechanical Engineering The Georgia Institute of Technology Atlanta, GA 30332

Summary This document reviews the steps that a beginner should take in order to adjust a Matlab plot for display in a print document. Specifically, this document explains: 1) How to scale the plot to frame the data. 2) How to display and adjust the legend. 3) How to adjust the display of data points and related model or uncertainty lines. 4) How to export a finished plot in various Windows-friendly formats.

How to Format a Matlab Graph Jeffrey Donell The Woodruff School of Mechanical Engineering

Experimental results are often represented graphically, and your graphs must package information clearly, simply and specifically. You achieve these goals by formatting your graphs or plots. Plotting tools, such as those in Excel and in Matlab, can give you great control over your information display, but they do not do all the work for you. After you generate a plot in Matlab, you must adjust that plots formatting in order to produce a good display. This document shows you the basic steps for adjusting a Matlab plots format, and it outlines the principles you should follow in making your format adjustments. We will show you how to adjust the graph shown below. Your experimental project results might be displayed in a Matlab plot that looks like this:

This is a perfectly acceptable chart. It is rich with information, and it provides no distractions from that information. Every line and axis has a specific label, with units easily visible. On the plot, paired/related data sets are visually related by the coordinated weights and patterns of the lines. There is no distracting non-data information on the plot.

How to Format a Matlab Graph Jeffrey Donell The Woodruff School of Mechanical Engineering

Your goal is to produce a clear and simple chart like that shown here. But when you prepare a plot using Matlabs defaults, your graph might look more like this:

In order to obtain the desired display, you need re-format this chart by hand. This document walks you through the process of scaling the axes, adjusting the legends appearance and placement, and setting the appearance of the data markers and model lines themselves. General: Scale the Axes to Frame the Data The first task in formatting a plot is to adjust the X- and Y-axes. As you do this, remember that your data should dominate the plot. Consequently, you should adjust the axis scales to eliminate blank space on the sides, top and bottom of the plot. HOWEVER: When you adjust the axis scales, you will probably introduce distorting offsets from the origin location on the chart; it is your job to determine whether these distortions are trivial or significant. You must always be able to characterize and explain such distortions, and your specific decisions about axis scales should take the problem of distortion into account. In this example, we assume that the problem of distortion is trivial, and we will scale the axes to frame the data very tightly.

How to Format a Matlab Graph Jeffrey Donell The Woodruff School of Mechanical Engineering

1) Scale the Chart In Matlab, Plot Editing must be enabled before you do anything. To do this, pull down the Tools menu and select Enable Plot Editing:

Now Matlab will let you adjust the display.

How to Format a Matlab Graph Jeffrey Donell The Woodruff School of Mechanical Engineering

In order to scale the axes, you must preselect an axis by clicking on the plot. Then re-open the Tools pull-down menu and select Axes Properties in order to begin editing:

With this selection made, the large Edit Axes Properties dialog box opens, allowing you to adjust the maximum and minimum values for each axis.

How to Format a Matlab Graph Jeffrey Donell The Woodruff School of Mechanical Engineering

Here, the Y-axis has been scaled to frame the data, y-grids have been removed and an axis label has been applied:

The changes have already been applied and are shown on the plot.

How to Format a Matlab Graph Jeffrey Donell The Woodruff School of Mechanical Engineering

Now the X-axis will be adjusted as well:

Unnecessary grids have been cleared, the axes are labeled and the data fills the whole of the chart.

How to Format a Matlab Graph Jeffrey Donell The Woodruff School of Mechanical Engineering

2) Adjust the Legend The tools menu is pulled down and the Legend is selected for display:

In this image, the legend has already been selected, and it is shown in its default position at the top right corner of the plot. Matlab places the legend directly on the plot. In most cases, such placement saves space and allows for a larger display; but this legend obscures some of the data. It must be moved to an empty region of the plot and it must be edited to display the correct descriptions of the data series.

How to Format a Matlab Graph Jeffrey Donell The Woodruff School of Mechanical Engineering

To move the legend, simply select and drag it with the mouse. Then select and type over each entry to provide specific descriptors for the different data series.

How to Format a Matlab Graph Jeffrey Donell The Woodruff School of Mechanical Engineering

10

The legend box resizes to accommodate long entries. The fully edited legend is shown below:

How to Format a Matlab Graph Jeffrey Donell The Woodruff School of Mechanical Engineering

11

3) Adjust the Display of Data Lines To adjust the data display, each line must be selected and edited individually. The principles for representing data sets are these: --A single data set can be represented with markers only. --When two or more data sets are presented, the markers are connected with straight (not smoothed) lines. Markers and lines must be visually distinct in order that the data sets can be distinguished. --When a model is graphed, it is represented as a smoothed line without markers. --When several models are shown, they can be grouped or distinguished through use of similar (or distinct) line patterns and weights. The student must determine which sets of data or of models are to be grouped, and the student must be able to explain any grouping decisions that s/he reaches. Here, we seek to distinguish line types so that we can reproduce this graph in black and white. To do this, we must adjust the line weights and line patterns--dots and dashes and the like. We must also be certain that our data points are represented appropriately.

The Model - Umodel line--the bottom line of this chart--is adjusted first: We select this line by double-clicking, and the Edit Line Properties dialog opens. This box offers a submenu allowing you to specify the lines color, size and style. For this display, we will set line Color to black. Matlabs default line width is too narrow for many printers to manage successfully; we will increase the 0.1 (point) line Size to 1.0. We select a line Style with wide dashes. These selections, and the resulting graph, are shown in the following display:

How to Format a Matlab Graph Jeffrey Donell The Woodruff School of Mechanical Engineering

12

The other uncertainty bands are formatted in the same fashion. The -Umodel bands use the same dash pattern, while the -Udata use a distinct, but coordinated dash pattern, as shown in the next illustration:

How to Format a Matlab Graph Jeffrey Donell The Woodruff School of Mechanical Engineering

13

Here, the uncertainty bands have all been formatted, grouping the model-bands and data bands through use of

coordinated line styles. Because only one set of measurements is shown, data points are represented here as markers without connecting lines.

How to Format a Matlab Graph Jeffrey Donell The Woodruff School of Mechanical Engineering

14

Here, with the data series Lit formatted as a medium-width, solid line, the graph is fully formatted.

How to Format a Matlab Graph Jeffrey Donell The Woodruff School of Mechanical Engineering

15

4) Options for Exporting a Finished Plot

This finished graph can be copied directly for use in Word or PowerPoint, or from the File menu, it can be exported in a variety of windows-friendly file formats.

You might also like