在PostScript(PS)中绘制坐标轴可以通过使用`moveto`和`lineto`命令来实现。以下是一个简单的例子,演示如何在PostScript中绘制一个带有x轴和y轴的坐标轴。
```postscript
% 设置画布大小和坐标轴范围
% 定义画布大小
/width 6.0 def
/height 4.0 def
% 定义坐标轴范围
/xmin -2.0 def
/xmax 2.0 def
/ymin -2.0 def
/ymax 2.0 def
% 定义画笔颜色
/setcolor { g save g setgray 1 set