是否可以仅将视口保存到plplot中的文件?

时间:2019-07-18 11:33:24

标签: fortran plplot

我只想将视口(红色边框)及其内容写入eps文件。那可能吗?此外,创建的eps文件的单位是“ pt”,但我要“ mm”。

我的代码:


  use :: plplot

  implicit none

  integer(4)        :: i_dummy

  real(8)               :: xmin, xmax, ymin, ymax

  real(8), dimension(5) :: x
  real(8), dimension(5) :: y

  character(len=80)     :: output_file_name

! set name of output file
  output_file_name = 'test_output.eps'
  call plsfnam(output_file_name)

! set plot device
  call plsdev('epscairo')
  i_dummy = plsetopt('geometry','210x297')

! set background color
  call plscolbg(255,255,255)    

! init
  call plinit()     

! set environment
  xmin = 0.0d0
  xmax = 210.0d0
  ymin = 0.0d0
  ymax = 297.0d0
  call plenv( xmin, xmax, ymin, ymax, 1, -1)

  x(1) = 0.0d0
  y(1) = 0.0d0

  x(2) = 105.0d0
  y(2) = 147.0d0

  x(3) = 210.0d0
  y(3) = 297.0d0

! set colour
  call plcol0( 9 )

! set line width
  call plwidth( 2.0d0 )

! set line style
  call pllsty( 2 )

! draw lines
  call plline( x, y )

! end
  call plend()

end program test_plplot

我得到了这个文件。有我要的红色部分,但带有白色边框,单位为“ pt”:

enter image description here

0 个答案:

没有答案