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”:
解决方案
推荐阅读
- python - QGraphicsScene上的错误坐标映射
- r - 如何使用 tmap_mode "plot" 缩小
- kotlin - Kotlin 扩展函数生成错误的字节码
- javascript - 创建标签开关
- node.js - 将回调的值分配给常量
- django-rest-framework - 缓存外部 API 调用 - Django
- ios - 重命名的深层链接 URL 不再打开我更新的 iOS 应用程序
- linux - 如何从文本文件中打印重复值的全名?
- python - 如何在 PyGame 画布上从 PyRealSense2 绘制视频帧?
- bash - 仅当名称中存在字符串时才复制目录和子目录