小编Mak*_*asu的帖子

是否可以在gnuplot中设置标签相对于键的位置?

我的情节的本质是绝对标签不起作用; 我不能限制y的范围,所以想知道是否有办法在键中包含我的标签文本或者相对于键放置它(即下面)

set term png enhanced size 1024,768
set title "{/=15 1D My title}\n - by me"
set xlabel "x"
set ylabel "y"
set label "V_0 = 10\n E = 1" #this is the bit I want to reposition
set out 'trial.png'
set xrange [-2.5:2.5]
set arrow from -2,-2000 to -2,2000 nohead size screen 0.025,30,45 ls 1
set arrow from 2,-2000 to 2,2000 nohead size screen 0.025,30,45 ls 1
plot 'data.dat'
Run Code Online (Sandbox Code Playgroud)

PS:还有,有没有更好的方法让我的垂直线在x = -2和x = 2?箭头解决方案再次不理想,因为我的y范围通常大于或小于2000.

text position gnuplot legend labels

4
推荐指数
1
解决办法
9110
查看次数

MINLOC是否适用于从索引0开始的数组?(Fortran 90/95)

使用C一段时间之后,我回到Fortran并在我的代码中将数组从索引0分配到N:

real(kind=dp), dimension(:), allocatable :: a 
allocate(a(0:50))
Run Code Online (Sandbox Code Playgroud)

我需要找到数组最小绝对值的索引,所以我使用MINLOC,并检查这个我将它与MINVAL进行比较:

minloc(abs(a(:)))
minval(abs(a))
Run Code Online (Sandbox Code Playgroud)

MINLOC的结果是指数,42但MINVAL的结果相当于41.以下是输出中的相关部分:

Index i    a(i) 

39         0.04667    
40         0.02222    
41         0.00222           !This was clearly the minimum value
42         0.02667

MINLOC = 42
MINVAL = 0.00222
Run Code Online (Sandbox Code Playgroud)

我假设这与Fortran内部没有正确处理索引为0的数组有关,因为以这种方式声明数组不是标准的Fortran样式(但它仍然是允许的!).

任何人都可以确认这一点或提供解决方法吗?

c arrays fortran min intrinsics

3
推荐指数
2
解决办法
498
查看次数

标签 统计

arrays ×1

c ×1

fortran ×1

gnuplot ×1

intrinsics ×1

labels ×1

legend ×1

min ×1

position ×1

text ×1