Mathcad Graphing Options: XY Plots and Chart Components
One of the most effective ways to convey the meaning of your data to others is by depicting it visually. In PTC Mathcad, the XY Plot has been a reliable workhorse for decades. In Mathcad Prime 5, the Chart Component was introduced, allowing you to create publication-ready graphs. So which should you use? To help you understand which choice is right for you, let’s compare and contrast the functionality in XY Plots and Chart Components.
What They Have in Common
If you are creating graphs, certain functionality will be common to XY Plots and Chart Components. These include:
Displaying multiple traces on the same graph
Applying linear and logarithmic scaling to the axes
Controlling the display of traces, including color, thickness, line style, and symbol
Toggling the display of tick marks and tick mark values
What is Unique to XY Plots
There are three things that XY Plots do a little better than Chart Components:
XY Plots have horizontal and vertical markers that can be added to the plot. These markers display the value of the line. In the Chart Component, you can add X- and Y- axis expressions with constant values to simulate markers, but they don’t display the value.
The trace expressions in the XY Plot have units holders that easily allow you to change the set of units for the trace as well as scale the values. (In Chart Components, you divide the axis expressions by the desired set of units.)
The Chart Component supports Scatter / Line / Area and Column traces. (Depending on your style settings, you can display scatter, line, and area at the same time.) XY Plots have eight types: line, column (vertical), bar (horizontal), stem, waterfall, error, box, and trace.
What Sets Chart Components Apart
Since the Chart Component was specifically created for visually stunning graphs, it has a lot more options for making your results beautiful:
You can define a title for the chart and control its position (above, under, top, bottom, or middle) and justification (left, center, or middle)
You can change the label for each trace so that it’s different than the name of the variable
These trace names appear in the legend. You can control the location and number of columns for this legend.
You have complete control over formatting of text in the Chart. Different elements (e.g., chart title, axis title, legend) can have different formatting.
Chart Components have separate controls for the color of the chart background, chart border, plot area, and plot border. The chart background and plot area can have a solid or gradient color. XY Plots support color for only the plot background, with three choices: paper color, transparent, or white.
You can display major and minor gridlines on the X- and Y- axes in a variety of different colors, thicknesses, and styles (e.g., lines, dots, dashes, alternating dots and dashes, etc.)
Chart Components can have minor gridlines. You control the number of minor ticks per major tick.
Chart Components have predefined templates for quick selection of standard trace styles, axes styles, and chart layouts (titles and legends).
The image can be exported to standard file formats like PNG, JPEG, GIF, BMP, SVG (Scalable Vector Graphics), and PDF.
Besides all these great controls over the look of the chart, there’s one advantage that the Chart Component has that sets it apart from the XY Plot: the second Y-axis. This is a huge differentiator when plotting dissimilar traces on the same graph.
Which Should You Choose?
XY Plots are good for when you don’t intend to share your work or apply significant formatting, or when you need special traces like bar, stem, error, or box. However, you should go with the Chart Component when you want to:
Dave Martin is a Creo, Windchill, and PTC Mathcad instructor and consultant. He is the author of the books “Top Down Design in Creo Parametric,” “Design Intent in Creo Parametric,” and “Configuring Creo Parametric,” all available at amazon.com. He can be reached at dmartin@creowindchill.com.
Dave currently works as the configuration manager for Elroy Air, which develops autonomous aerial vehicles for middle-mile delivery. Previous employers include Blue Origin, Amazon Prime Air, Amazon Lab126, and PTC. He holds a degree in Mechanical Engineering from MIT and is a former armor officer in the United States Army Reserves.
Mathcad Graphing Options: XY Plots and Chart Components
In this blog, learn the differences between PTC Mathcad Prime's XY Plot and Chart Component functionalities.
Selected Language Unavailable
This experience is not available in the language you selected.
To view this experience, please continue in your current language.