gnuplot绘制的图像的输出

本文介绍了gnuplot如何设置输出图像的大小、颜色以及如何生成矢量图像,如EMF格式。gnuplot支持多种图像类型,包括PNG、PDF、PostScript等,并可以通过set grid命令设置网格显示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

set term png {small | medium | large} {monochrome | gray | color} 
后面两项分别代表图中字体的大小和图像的颜色(黑白,灰度,彩色,默认彩色可以用xRRGGBB的RGB值来表示颜色)

其实,可以另存为矢量图像,这样看起来会更清晰,gnuplot支持emf格式的矢量图像:
set term emf
set output "1-2.emf"
此时代表文字大小的 {small | medium | large} 不可用,默认仍然是彩色图像,另外,set size 不可用(可用执行,但是效果不会改变图像大小,只会改变有效图像在整个图像中的面积,如 set size 0.5,0.5,那么,仅左下四分之一处有图像,其余空白)

BTW:可以使用set grid 20 来设置显示网格,其中20代表使用的线型,与plot中使用的线型使用一样的数值表示(个人感觉20号线型做网格还不错:))

附:gnuplot支持的图像类型列表:
           aed512  AED 512 Terminal
           aed767  AED 767 Terminal
             aifm  Adobe Illustrator 3.0 Format
         bitgraph  BBN Bitgraph Terminal
              cgm  Computer Graphics Metafile
            corel  EPS format for CorelDRAW
             dumb  printer or glass dumb terminal
              dxf  dxf-file for AutoCad (default size 120x80)
            eepic  EEPIC -- extended LaTeX picture environment
              emf  Enhanced Metafile format
            emtex  LaTeX picture environment with emTeX specials
         epslatex  LaTeX (Text) and encapsulated PostScript
     epson_180dpi  Epson LQ-style 180-dot per inch (24 pin) printers
      epson_60dpi  Epson-style 60-dot per inch printers
      epson_lx800  Epson LX-800, Star NL-10, NX-1000, PROPRINTER ...
              fig  FIG graphics language for XFIG graphics editor
              gif  GIF format [mode] [fontsize] [size] [colors]
             gpic  GPIC -- Produce graphs in groff using the gpic preprocessor
          hp2623A  HP2623A and maybe others
           hp2648  HP2648 and HP2647
           hp500c  HP DeskJet 500c, [75 100 150 300] [rle tiff]
             hpdj  HP DeskJet 500, [75 100 150 300]
             hpgl  HP7475 and relatives [number of pens] [eject]
           hpljii  HP Laserjet series II, [75 100 150 300]
             hppj  HP PaintJet and HP3630 [FNT5X9 FNT9X17 FNT13X25]
           imagen  Imagen laser printer
             jpeg  JPEG images using libgd and TrueType fonts
       kc_tek40xx  MS-DOS Kermit Tek4010 terminal emulator - color
       km_tek40xx  MS-DOS Kermit Tek4010 terminal emulator - monochrome
            latex  LaTeX picture environment
               mf  Metafont plotting standard
              mif  Frame maker MIF 3.00 format
               mp  MetaPost plotting standard
          nec_cp6  NEC printer CP6, Epson LQ-800 [monocrome color draft]
          okidata  OKIDATA 320/321 Standard
              pbm  Portable bitmap [small medium large] [monochrome gray color]
             pcl5  HP Designjet 750C, HP Laserjet III/IV, etc. (many options)
              pdf  PDF (Portable Document File) file driver
              png  PNG images using libgd and TrueType fonts
       postscript  PostScript graphics language [mode "fontname" font_size]
          pslatex  LaTeX picture environment with PostScript /specials
            pstex  plain TeX with PostScript /specials
         pstricks  LaTeX picture environment with PSTricks macros
              qms  QMS/QUIC Laser printer (also Talaris 1200 and others)
            regis  REGIS graphics language
             rgip  RGIP metafile (Uniplex). Option: fontsize (1-8)
          selanar  Selanar
            starc  Star Color Printer
              svg  W3C Scalable Vector Graphics driver
            table  Dump ASCII table of X Y [Z] values to output
      tandy_60dpi  Tandy DMP-130 series 60-dot per inch graphics
          tek40xx  Tektronix 4010 and others; most TEK emulators
          tek410x  Tektronix 4106, 4107, 4109 and 420X terminals
          texdraw  LaTeX texdraw environment
             tgif  TGIF X11 [mode] [x,y] [dashed] ["font" [fontsize]]
         tkcanvas  Tk/Tcl canvas widget [perltk] [interactive]
             tpic  TPIC -- LaTeX picture environment with tpic /specials
          uniplex  RGIP metafile (Uniplex). Option: fontsize (1-8) (Same as rgip)
          unknown  Unknown terminal type - not a plotting device
            vttek  VT-like tek40xx terminal emulator
              x11  X11 Window System
              X11  X11 Window System (identical to x11)
             xlib  X11 Window System (gnulib_x11 dump)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值