Application Center - Maplesoft

App Preview:

Customizing Plot Annotations in Maple 11

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

Image
Customizing Plot Annotations in Maple 11
? Maplesoft, a division of Waterloo Maple Inc., 2007 

Introduction 

In Maple 11, you can add annotations to your 2D plots to increase reader comprehension and enhance appearance.  This document demonstrates the use and customization of titles, legends, captions, and tickmarks through interactive menus and commands. Examples include adding 2D math notation to plot titles, controlling the placement of legends, and creating plots with axes tickmarks appearing at multiples of Typesetting:-mrow(Typesetting:-mi(.Other plot annotations are available using the new Drawing Canvas tools.  See Tips and Techniques: Plot Annotations and the Drawing Canvas in Maple 11 for details.
 

Plot_2d 

 

Typeset Text and Math in Titles/Legends/Captions 

In Maple 11, you can use 2-D math notation in titles, legends and captions in 2-D mode.  You can insert 2-D math using the context-sensitive menus, or through options to the plot command.  You can also use the techniques found in the Tip and Techniques, dealing with Annotations and the Drawing Canvas, to add notes and drawing of lines, arrows and shapes to a curve.  This will allow you to add text and 2-D math to the plot, so that you can further customize the plot. 

Interactive Method: 

 

After you have created a 2-D plot, you can right-click on the plot and do one of the following: 

 

  • For a title, select Title>Add Title
 

  • For a caption, select Title>Add Caption
 

  • For a legend, select Legend>Show Legend, then double-click and edit the legend text
 

 

The following are some steps to add a title to a plot: 

 

  • Right-click on the existing plot
 

Image 

  • You will see the default title for the plot
 

  • Double-click the "New title" string and delete
 

Typesetting:-mrow(Typesetting:-mi(Typesetting:-mo(Plot_2d

Enter your title.  To enter 2-D math, press F5 to switch to Math Mode. Enter the 2-D math normally, just as you would elsewhere in the document. 

Typesetting:-mrow(Typesetting:-mi(Typesetting:-mo(Plot_2d

 

Maple Command Method: 

 

The following command illustrates a plot with some simple 2-D Math in its title.  By entering the command in math mode, you can specify your title using the 2-D math editor.  Notice the use of single quotes around the title.  This prevents the expression from being evaluated, so that the title is Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mo( instead of Typesetting:-mrow(Typesetting:-mi(. 

 

Typesetting:-mrow(Typesetting:-mo( 

Plot_2d
 

 

To combine 2-D math and text in any of these fields, you need to use the typeset command.  Normally text is passed in as a string, using double quotes.  The following command shows this: 

 

Typesetting:-mrow(Typesetting:-mi( 

Plot_2d
 

 

If you are using 1-D maple syntax to code the plot command, enter the function the same way as for the 2-D input method: 

 

> plot(cos(x),x=-5..5,title='diff(sin(x), x)',legend=[typeset("The curve of ",'diff(sin(x),x)')] );
 

Plot_2d
 

Spacing Axis Tickmarks 

In Maple 11, you have much more control over the format and spacing of your 2-D plot axis tickmarks.  You can specify the spacing between tickmarks, even setting them to be a multiple of Typesetting:-mrow(Typesetting:-mi(.  More information on this option is available from the plot,tickmarks help page.  Below, you can learn how to do this both using the context menus and programmatically. 

Interactive Method: 

 

If you have already created a 2-D plot and would like to change the tickmark spacing, follow these steps: 

 

  • Right click on the plot
 

  • Select Axes>Properties
 

  • Uncheck the "Let renderer choose tickmarks" option
 

  • Check the "Custom Spacing" option
 

  • If you want spacing in multiples of Typesetting:-mrow(Typesetting:-mi(, check the "Multiply by Pi" option
 

  • Specify the space between tickmarks in the space provided.  If you selected "Multiply by Pi", the spacing will be Typesetting:-mrow(Typesetting:-mi( multiplied by this number.
 

Typesetting:-mrow(Typesetting:-mi(Typesetting:-mo(Plot_2d

 

 

Image 

 

Note: To modify tickmarks on the vertical axis, select the "Vertical Axis" button and follow the same steps. 

Maple Command Method: 

 

The following command creates a plot with tickmarks spaced at Typesetting:-mrow(Typesetting:-mn( 

 

Typesetting:-mrow(Typesetting:-mi( 

Plot_2d
 

 

To change the spacing for the vertical axis, replace the default in the tickmarks option to the desired spacing.  For example if in the above example, you wanted the tickmarks on the vertical axis to appear at y = -1, 0, 1; then you would use the following command: 

 

Typesetting:-mrow(Typesetting:-mi( 

 

Using Symbols Other Than Typesetting:-mrow(Typesetting:-mi( 

Typesetting:-mrow(Typesetting:-mi( isn't the only symbol that the tickmark labels can use.  With Maple commands, you can specify the tickmark spacing to be a multiple of any symbol that evalf can evaluate to a float and that symbol will be displayed at the tickmarks.  You can find more information on this option by going to the plot,tickmarks help page. 

 

Controlling the Placement of Legends 

Within the plot command, you can control legends using the legendstyle option. This option controls the font and placement of legends in your plots.  Possible locations for a legend are top, bottom, right, and left.  Legend options can be altered using context menus for existing plots, or through options with the Maple plot commands. 

Interactive Method: 

 

You can add a legend and specify its location by following these steps: 

  • Right-click on the plot to display the context menu
 

  • Select Legend>Show LegendDouble click on the default text to change it
 

  • To choose the location of the legend select Legend>Position from the context menu
 

 

Plot_2d

Maple Command Method: 

 

Below is the command to specify both the legend text and location.  The legend option is used for the legend text, and the legendstyle option for the location. 

 

Typesetting:-mrow(Typesetting:-mi( 

Plot_2d
 

 

Note: Use lists when specifying the curves and legend.  This will make each curve correspond to the legend entry in the same position. 

Legal Notice: The copyright for this application is owned by Maplesoft. The application is intended to demonstrate the use of Maple to solve a particular problem. It has been made available for product evaluation purposes only and may not be used in any other context without the express permission of Maplesoft.   

Image