home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-06-15 | 2.0 KB | 50 lines | [TEXT/DWat] |
- % Asymptote Macros
- %
- % Use this macros file to define useful, one-line command macros.
- % The first item in each line is the macro name. Asymptote processes
- % a command macro, it replaces the macro name with the macro definition.
- %
- % You can pass arguments to macros using the '&' character followed by
- % the argument number.
- %
- % You can specify what file you want to use for your Command Macros file
- % with the File>Options>Command Macros File command.
- %
- % These are some examples of the kinds of things you can do with command macros.
- %---------------------------------------------------------------------------------
- % Conversion macros:
- %---------------------------------------------------------------------------------
-
- % convert the value in the X array from wavelength in microns to frequency in Hz
- Xµm->Hz rpn 2.997925E14 <x / >x
-
- % Multiply X or Y by a constant
- scaleX rpn <x &1 * >x
- scaleY rpn <y &1 * >y
-
- % Convert X or Y to log values
- logX rpn <x log >x
- logY rpn <y log >y
-
- %---------------------------------------------------------------------------------
- % 'Shorthand' macros to save typing
- %---------------------------------------------------------------------------------
-
- stars pointstyle 5 filled % set the point style to filled stars
-
- % These macros move the cursor to the TopLeft, BottomRight, etc.
- % corner of the graph rectangle. You can use these to add labels
- % to your graph.
- TL move xleft xright xleft - .1 * + ybottom ytop ybottom - .9 * +
- BL move xleft xright xleft - .1 * + ybottom ytop ybottom - .1 * +
- TR move xleft xright xleft - .9 * + ybottom ytop ybottom - .9 * +
- BR move xleft xright xleft - .9 * + ybottom ytop ybottom - .1 * +
- Center move xleft xright 2 / ybottom ytop 2 /
-
- %---------------------------------------------------------------------------------
- % Helpful aliases.
- %---------------------------------------------------------------------------------
- % You can use command macros to define Asymptote commands to make them easier
- % for you to remember or more compatable with the commands in other graphics programs.
- lineto drawto
- exit quit