Message Boards Message Boards

0
|
4035 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

Issue on exporting a simple image object

Posted 9 years ago

Please consider the code below (this is a simpler version of the original problem)

w = 100.;
l = 150.;
pi = {{-.5 w - l, .5 l}, {-.5 w, .5 l + w}};
reti = Rectangle[pi[[1]], pi[[2]]];
gr = Graphics[{reti}];
Export["~/black_rectangle.gif", gr] 

The created image has a white space framing the rectangle. How to export an image of a totally black rectangle? Thanks in advance

POSTED BY: Luiz Melo

Try

gr = Graphics[reti, PlotRangePadding -> 0]

That eliminated the extra white space for me. If that does not work for your system, try PlotRangePadding -> -1 then it should work.

POSTED BY: Nasser M. Abbasi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract