2

我已经绘制了两个向量 (3,3,2), (2,2,1) 并想在第一个向量上添加一个 AABB 以显示第二个向量在第一个向量的范围内。

添加set object rectangle from screen 0,0 to screen 3,3 front不起作用。那么如何绘制 AABB(或 a=3、b=3 和 c=2 的长方体)?

另外,如何将 y 轴的刻度放在左侧。

还开着:

  • 将 y 轴的比例限制在左侧,将 x 轴的比例限制在前下方
  • 向 x、y 和 z 轴添加箭头
  • 删除第二个 x 轴和 y 轴,以便每个左侧只有一个

Gnuscript资源_vec_aabb

set xyplane 0
set grid

set xrange [0:5]
set yrange [0:5]
set zrange [0:5]


splot 'resource_vec_aabb.dat' with vectors filled head lw 2

数据资源_vec_aabb.dat

# Gnuplot .dat file for vectors
0   0   0   3   3   2
0   0   0   2   2   1

图形

更新

set termoption dashed   #Needs to be set to draw dashed lines

set border 19           #To set axis (1 + 2 + 16). See: set border help
set xyplane 0
set grid
unset key

my_range = 4

set xrange [0:my_range]
set yrange [0:my_range]
set zrange [0:my_range]

set arrow from graph 0,0,0 to graph 1.05,0,0 size screen 0.025,15,60 \
    filled ls 1 linecolor rgb "black"
set arrow from graph 0,0,0 to graph 0,1.05,0 size screen 0.025,15,60 \
    filled ls 1 linecolor rgb "black"
set arrow from graph 0,0,0 to graph 0,0,1.05 size screen 0.025,15,60 \
    filled ls 1 linecolor rgb "black"

set xtic 1
set ytic 1
set ztic 1

# AABB for 3,3,2
set arrow from 3,0,0 to 3,3,0 nohead linetype 2 linecolor rgb "green"
set arrow from 3,3,0 to 3,3,2 nohead linetype 2 linecolor rgb "green"
set arrow from 0,3,0 to 3,3,0 nohead linetype 2 linecolor rgb "green"
set arrow from 0,3,2 to 3,3,2 nohead linetype 2 linecolor rgb "green"
set arrow from 0,3,0 to 0,3,2 nohead linetype 2 linecolor rgb "green"
set arrow from 0,0,2 to 0,3,2 nohead linetype 2 linecolor rgb "green"
set arrow from 0,0,2 to 3,0,2 nohead linetype 2 linecolor rgb "green"
set arrow from 3,0,0 to 3,0,2 nohead linetype 2 linecolor rgb "green"
set arrow from 3,0,2 to 3,3,2 nohead linetype 2 linecolor rgb "green"

# 2,2,1
set arrow from 2,0,0 to 2,2,0 nohead linetype 2 linecolor rgb "blue"
set arrow from 0,2,0 to 2,2,0 nohead linetype 2 linecolor rgb "blue"
set arrow from 2,2,0 to 2,2,1 nohead linetype 2 linecolor rgb "blue"
set arrow from 0,0,1 to 2,0,1 nohead linetype 2 linecolor rgb "blue"
set arrow from 0,0,1 to 0,2,1 nohead linetype 2 linecolor rgb "blue"
set arrow from 0,2,1 to 2,2,1 nohead linetype 2 linecolor rgb "blue"
set arrow from 2,0,1 to 2,2,1 nohead linetype 2 linecolor rgb "blue"
set arrow from 2,0,0 to 2,0,1 nohead linetype 2 linecolor rgb "blue"
set arrow from 0,2,0 to 0,2,1 nohead linetype 2 linecolor rgb "blue"

set view 40,44,1
splot 'resource_vec_aabb.dat' with vectors filled head lw 2

新输出

更新后的版本

4

0 回答 0