Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Plot multiple rectangles from file

379 views
Skip to first unread message

ivailo...@gmail.com

unread,
May 10, 2015, 11:19:04 AM5/10/15
to
Hi everyone,
currently I want to create multiple rectangles. I want to obtain the coordinates from text file. As there will be 100+ rectangles, I think loop is needed, but I have no idea how to create a loop for set rect, getting the coordinates from the file. Can you help me?

Michael Okuntsov

unread,
May 10, 2015, 1:39:59 PM5/10/15
to
10.05.2015 21:19, ivailo...@gmail.com пишет:
> Hi everyone,
> currently I want to create multiple rectangles. I want to obtain the coordinates from text file. As there will be 100+ rectangles, I think loop is needed, but I have no idea how to create a loop for set rect, getting the coordinates from the file. Can you help me?
>

Here is my scritp for plotting some schematics. Hope this helps.

set enc utf8
set term post eps font ",8" adobeglyphnames
set output "data1_boxes.eps"
set size ratio 0.9
set xrange [-1:88]
set yrange [-1:82]
unset key;unset border;unset tics
do for [i=0:3] {
do for [j=0:3] {
set object j+1+i*4 rect from 22.33*j, 20.5*i rto 20., 19.5 noclip fs
empty border rgb "black" lw 3
}
}
set object 20 rect from 0,0 rto 20.,19.5 noclip fc "grey80"
set object 21 rect from 22.33*3,0 rto 20.,19.5 noclip fc "grey80"
set object 22 rect from 0,20.5*3 rto 20.,19.5 noclip fc "grey80"
set object 23 rect from 22.33*3,20.5*3 rto 20.,19.5 noclip fc "grey80"
plot -10000 notitle

Michael Okuntsov

unread,
May 10, 2015, 1:53:32 PM5/10/15
to
Sorry, I've missed the part where you wrote about getting coordinates
from the file. You can look at this:
http://www.gnuplotting.org/object-placement-using-a-data-file/ .

Ivailo Radev

unread,
May 10, 2015, 3:40:58 PM5/10/15
to
Thank you very much. The first part was not exactly what I was looking for, but it was also helpful. I will take a look at the second part tomorrow and hope this will help me. Thank you again.
0 new messages