Drawing a square from bottom to the top of the graph gnuplot

自古美人都是妖i 提交于 2020-08-10 18:51:28

问题


I am trying to create an object, a rectangle from the bottom of the x axis (15,32) right to the top. It should be an easy task and I have tried various coordinates but I dont seem to be able to do it right. Can anyone help?

> set palette defined ( -1.0 "blue",\
>                  -0.5 "light-blue",\
>                     0 "white",\
>                   0.5 "light-red",\
>                      1.0 "red")
>                                    set cbrange [ 1.000: -1.000] set pm3d map corners2color c2 set ytics    (1.000,  50.00, 100.00, 150.00,
> 200.00, 250.00, 300.00, 350.00, 400.00, 450.00, 500.00, 550.00, 600.00, 650.00, 700.00, 750.00, 800.00, 850.00, 900.00, 924.00) set xtics    (1.000,  50.00, 100.00, 150.00, 200.00, 250.00, 300.00,
> 350.00, 400.00, 450.00, 500.00, 550.00, 600.00, 650.00, 700.00, 750.00, 800.00, 850.00, 900.00, 924.00) set xlabel "Residue" set ylabel "Residue" set yrange [   0.000: 926.000] set xrange [   0.000:
> 926.000] set object 1 rectangle from 1,308 to 308,1 front fs empty border rgb "black" set object 2 rectangle from 309,616 to 616,309
> front fs empty border rgb "black" set object 3 rectangle from 617,924
> to 924,617 front fs empty border rgb "black" set obj rect from 1,
> graph 15 to 32, graph 1 front fs empty border rgb "black"

Would be great if anyone can help


回答1:


Please have a look at the manual or in gnuplot console type help coordinates.

I assume you want a rectangle from x=15, bottom graph border to x=32, top graph border.

set object 4 rect from first 15, graph 0 to first 32, graph 1

or since default coordinate system is first, a bit shorter

set object 4 rect from 15, graph 0 to 32, graph 1


来源:https://stackoverflow.com/questions/62899209/drawing-a-square-from-bottom-to-the-top-of-the-graph-gnuplot

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!