- Published: Wednesday, 21 September 2011
- Written by Jon Chandler
- Hits: 4292
Often, it's useful to plot data gathered by a microcontroller system. Data might be temperature vs time, voltage vs current or any other information. An X - Y plot can aid in understanding information. Microsoft Excel can easily polt many types of data.
The first issue is getting the desired data from a microcontoller system. The usual method is to capture a data stream in a terminal emulator and to save the data in a file. A little forethought in microcontroller programing will make plotting easier. A common format is CSV or comma-separated-values. Each x-y pair is one a single line, separated by a comma and the line is terminated with a carriage return (chr$(13)) and a line feed (chr$(10)). The captured data file will look something line this:
Files formatted like this are easily imported into Excel.
Start Excel and open the text file. You'll see a screen something like this:
Select the delimited option and the screen will change to this:
Check comma as the delimiter and click next. The data will be placed in two columns representing x and y values.
Now that the hard part is done, select the data for the graph.
Next, click INSERT on the menu bar and select SCATTER PLOT.
The scatter menu shows several options - straight lines between points, curve-fit lines and markers or not. Select the desired format. Be sure to select the SCATTER option rather than the LINE option.
A small version of the plot will be shown on the sheet. Right-click in the body of the graph, select NOVE GRAPH and choose new sheet.
The graph will be created full size in its own sheet. Next, right-click in the axes to change scaling. I like to choose fixed scaling to maximize plot area. If several graphs are to be compared, it's best to fix the scaling the same on each for easy comparison.
Finally, with a little editing is the final graph.
The process is pretty simple. There are a lot of options to be investigated to achieve the look you want.