One of the most effective ways to convey the meaning of your data to others is by depicting it visually. In PTC Mathcad, the “native” 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
- Major y-axis and x-axis gridlines with custom color
- Plot and axis titles with custom text formatting
- Customizable legends, including location and text formatting
PTC Mathcad Prime 12 added several enhancements to XY Plots to give them more features that Chart Components have. Learn more in this video:
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 change the label for each trace so that it’s different than the name of the variable.
- You have even greater control over formatting of text (chart title, axis title, legend) 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.
- Chart Components can have minor gridlines and minor tick marks. You control the number of minor ticks per major tick.
- You can display major and minor gridlines on the X- and Y- axes in a greater variety of different colors, thicknesses, and styles (e.g., lines, dots, dashes, alternating dots and dashes, etc.) compared to native XY Plots.
- 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.
Graphing Options for Art
Check out how Mathcad users creatively used the graphing options to create math art
Get Inspired
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:
- Share your work with others
- Use a second Y-axis or minor ticks
- Export your chart for use in other applications
Have you tried the Chart Component? If not, you can get up to speed with the video playlist below. (Setting up the Chart Component, Formatting the Chart Component, and Additional Options and Exporting the Chart Component.) Documenting your calculations should be a huge part of your engineering calculations, and both XY Plots and Chart Components can elevate your worksheets.
Up Next
Get more tips
Subscribe to the Mathcad Minute newsletter for more tips to your inbox.
Subscribe Now