0%

PGPLOT cpgbeg 打开一个图形设备

cpgbeg – 打开一个图形设备

对应的C函数为

1
int cpgbeg(int unit, const char *file, int nxsub, int nysub);

新的程序最好用PGOPEN而不是PGBEG。PGOPEN会保留现存程序的兼容性。PGBEG不像PGOPEN,它将关闭打开的任何图形设备,所以对于它不能被用于并行的打开设备。

PGBEG 为随后的绘图打开一个图形设备或者一个文件。在调用其他子程序之前,都必须使用PGBEG或PGOPEN打开一个设备。

返回值:

PGBEG : 返回1成功,其他失败并在标准错误单元中显示错误信息。

参数:

  • UNIT (输入) : 0(惯例)
  • FILE (输入) : 输出设备或文件名,参考PGOPEN
  • NXSUB (输入) : 视图面细分的X轴(横向)个数
  • NYSUB (输入) : 视图面细分的Y轴(纵向)个数

PGPLOT将在屏幕上显示NXSUB * NYSUB个图像。如果有N个细分视图的话,PGPAGE 将移动到下一个子视图,而不是下一个物理页。如果NXSUB > 0, PGPLOT将横向排列,如果 NXSUB <0, PGPLOT将纵向排列。

如果const char *file,那么输出为:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Graphics device/type (? to see list, default /Xserve): ?
PGPLOT v5.2.2 Copyright 1997 California Institute of Technology
Interactive devices:
/XWINDOW (X window window@node:display.screen/xw)
/XSERVE (A /XWINDOW window that persists for re-use)
Non-interactive file formats:
/GIF (Graphics Interchange Format file, landscape orientation)
/VGIF (Graphics Interchange Format file, portrait orientation)
/LATEX (LaTeX picture environment)
/NULL (Null device, no output)
/PNG (Portable Network Graphics file)
/TPNG (Portable Network Graphics file - transparent background)
/PS (PostScript file, landscape orientation)
/VPS (PostScript file, portrait orientation)
/CPS (Colour PostScript file, landscape orientation)
/VCPS (Colour PostScript file, portrait orientation)
Graphics device/type (? to see list, default /Xserve):
处无为之事,行不言之教;作而弗始,生而弗有,为而弗恃,功成不居!

欢迎关注我的其它发布渠道