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

plotting filled rectangle at given coordinated

1,100 views
Skip to first unread message

sche...@gmail.com

unread,
Jan 30, 2008, 10:07:51 AM1/30/08
to
hi,

I am new to gnuplot, and I couldn't find it in the docs in reasonable
time..
I need to plot a few rectangles using their vertex coordinates. The
rectangles may overlap.
For example (start denoted upper left corner, end - lower right
corner):
rect1: x_start=10 y_start=20 x_end=100 y_end=100
rect2: x_start=20 y_start=40 x_end=80 y_end=70
....
I can have file with these numbers in any needed format.

what is the simplest way to do it with gnuplot?

thanks,
Stas

Joerg Hau

unread,
Jan 30, 2008, 11:00:24 AM1/30/08
to
Hi,

On Wednesday 30 January 2008 16:07, sche...@gmail.com wrote:

> I need to plot a few rectangles using their vertex coordinates. The
> rectangles may overlap.
> For example (start denoted upper left corner, end - lower right
> corner):
> rect1: x_start=10 y_start=20 x_end=100 y_end=100
> rect2: x_start=20 y_start=40 x_end=80 y_end=70
> ....
> I can have file with these numbers in any needed format.
>
> what is the simplest way to do it with gnuplot?

set obj rect from 10,20 to 100,100 fc rgb 'red'
set obj rect from 20,40 to 80,70 fc rgb 'green'

Use "help set obj" for more info.

Cheers + HTH,

- Joerg


--
joerg dot hau at swissonline dot ch * Lausanne, Switzerland
http://homepage.sunrise.ch/mysunrise/joerg.hau/
"All standard disclaimers apply".
remove the obvious from my address to reply

Ethan Merritt

unread,
Jan 30, 2008, 11:22:41 AM1/30/08
to

sche...@gmail.com

unread,
Jan 31, 2008, 8:56:38 AM1/31/08
to
Joerg, Ethan,

thanks for your help!
On my system there was gnuplot 4.0 which didn't have such object...

thanks again,
Stas

0 new messages