Navigation:  How do I ...? > Printing >

How do I print blank graph paper?

Print this Topic Previous pageReturn to chapter overviewNext page

This topic will walk you through creating publication-quality blank graph paper using a macro. You can easily adapt the macro to other scale types (this example uses log-log scaling) or other parameters for this same scaling. Dont want to be bothered with creating a macro? There really isnt much to it and the macro will make this operation easily repeatable, but in any case you can manually perform the same actions taken by the macro; see below for an explanation of each command and the equivalent menu command or other action in blue text.

Several additional graph paper examples, with ready-to-print PDF files, are shown on the DPlot web site at http://www.dplot.com/graphpaper.htm.

1)Select the Macro command on the File menu. Enter a name for the macro that you're about to create that you'll remember next week. In the example below we'll be creating log-log graph paper with 3 cycles on the X axis, 4 on the Y, so name the macro "loglog3x4". Now click the "Edit/Create" button.
2)Select the bold text below with your mouse, right-click and select Copy. In the Macro Editor, click the Paste button. If you want to assign a shortcut key to the macro, select one of the key combinations in the "Shortcut" list. Now click the "Save" button to save the macro. To now run the macro and create your graph paper, if you used a shortcut key you can simply press that key combination. Otherwise, select the Macro command from the File menu, select your macro from the list, and click "Run"

FileNew()              ' Create a blank XY plot

XYXY(2,1,1,1000,10000) ' Adds 2 points

Scale(4)               ' Log X - Log Y

LineType(1,0)          ' Don't draw the "curve"

SymbolType(1,0)

Size(1,6,8,1)          ' Size of the graph (6" wide x 8" high)

NumberFormat(0,12)     ' 12="none" for number format

NumberFormat(1,12)     '   This means numbers won't

'                          be drawn on the axes

LineWidth(-1,20)       ' Pen for axes is 0.02 inches

LineWidth(0,10)        ' Pen for major grid lines is 0.01 inches

LineWidth(-3,5)        ' Pen for minor grid lines is 0.005 inches

GridLines(1)           ' Box around plot w/ grid lines

DenseGridLines(1)      ' Looks a bit crowded on the display,

'                          but nice when printed

Color(0,128,128,128)   ' Set grid color to a med. gray

3)For help on any macro commands, simply move the text insertion point to the appropriate line and click the Help button in the macro editor. Each of the commands shown above is explained in more detail below. Again, blue text is used to describe the manual action that is equivalent to the macro command.

XYXY(2,1,1,1000,10000) ' Adds 2 points

DPlot will not display a graph (or blank graph paper) without data. So we create a new curve with 2 points, from (1,1) to (1000,10000). This gives us 3 log cycles on the X axis, 4 cycles on the Y axis. The resulting line will subsequently be hidden.

Select the Edit Data command on the Edit menu, or click the Edit Data button. Enter 1,1 for the first point. Click the Add button. Enter 1000,10000 for the second point. Click OK.

Scale(4)               ' Log X - Log Y

With the text cursor on this line, click the Help button to show codes for other scale types.

Right-click within the plot and select “Logarithmic X Logarithmic Y”.

LineType(1,0)          ' Don't draw the "curve"

SymbolType(1,0)

We don't want to display the curve; we only created it to set our extents. So we use "None" for both the line type and symbol type.

Right-click on the line and select Line style>None and, if necessary, repeat with Symbol style>None.

Size(1,6,8,1)          ' Size of the graph

The first '1' simply says: "specify the size", rather than allow DPlot to fill the output device with the graph. We've set the width of the graph box to 6 inches and the height to 8 inches. Note that this is the same aspect ratio as the number of log cycles, so our log cycles will be square. If you use more or fewer log cycles then you'll of course need to adjust the size if you want to maintain square log cycles.

Select the Extents/Intervals/Size command on the Options menu, check “Specify size”, then enter the desired graph paper width and height in inches.

NumberFormat(0,12)     ' 12="none" for number format

NumberFormat(1,12)     '   This means numbers won't

'                          be drawn on the axes

Click the Help button to show other number format codes. We've selected "None", so numbers won't be drawn on the graph paper at all. All we'll have is the grid. If you want numbers to be printed, then of course you should use a different number format or delete these lines entirely.

Right-click on any number on the X axis and select “None”. Repeat for the Y axis.

LineWidth(-1,20)       ' Pen for axes is 0.02 inches

LineWidth(0,10)        ' Pen for major grid lines is 0.01 inches

LineWidth(-3,5)        ' Pen for minor grid lines is 0.005 inches

Pen widths are in 1000'ths of inches. These settings may require a bit of experimentation on your printer.

Select the Symbol/Line Styles command on the Options menu. Under “Other lines” enter the desired line widths for the axes (the box around the graph) and the major and minor grid lines.

GridLines(1)           ' Box around plot w/ grid lines

0=axes only, no grid lines, 2=box around plot with tick marks

Click the “Grid lines” button or select Options>Grid Lines or Box>Grid lines.

DenseGridLines(1)      ' Looks a bit crowded on the display,

'                          but nice when printed

Self-explanatory. Change the "1" to a "0" to see the difference.

Select Options>Extents/Intervals/Size. Enter any number greater than 1 for the “Minor grid/tick divisions” on both the X and Y axes.

Color(0,128,128,128)   ' Set grid color to a med. gray

By default, grid lines are drawn with a lighter gray (192,192,192).

Click the Colors button.

 

 


Page url: https://www.dplot.com/help/index.htm?how_graphpaper.htm