Group Abstract Group Abstract

Message Boards Message Boards

Must be an easy question - 4 pictures in a grid - without unwanted borders

Posted 10 years ago

Just a simple plot:

> rr = Plot[Sin[x], {x, 0, 10}, Background -> Brown]

The plot is placed 4 times in Grid:

> res2 = Grid[{{rr, rr}, {rr, rr}}, Spacings -> {0, 0}, Frame -> None, FrameStyle -> None, Dividers -> None]

Export to the cloud:

CloudExport[res2, "PNG", "plot2"]

the picture has 2 white lines. The one on the bottom is a little thicker. How do I remove these? remove the 2 white lines

Are you able to remove the white lines? I tried

> Rasterize[res2,ImageSize -> 1000]

The first white line is not white anymore but brown because the vertical axes do not connect as the should be. The bottom white line stays white.

I don't want to use CloudDeploy but this works (vertical axes are connected)

> CloudDeploy[res2, "plot"]

If I use ExportForm in the CloudDeploy to force a png picture same issue appears.

I must have missed something...

4 Replies

3 lines as material to work with:

rr = Plot[Sin[x], {x, 0, 10}, Background -> Brown]
ar = Table[rr, {3}, {3}];
gr = Grid[ar, Frame -> All, FrameStyle -> Directive[{Thickness[3], Red}], Spacings -> {0, 0}]

Evaluate

Export["pic.gif", gr, "GIF"]
Export["pic.png", gr, "PNG"]
Export["pic.svg", gr, "SVG"]

enter image description here

A normal export without any cloud involved shows already the artifact. If a setting of Background->Brown is used in the Export is shows:

enter image description here

There is a way to remove the stitching error.

as = ImagePad[ImageAssemble[ar],2,Red]
CloudExport[as, "GIF"]

The picture is now stitched with ImageAssemble and a border is added with ImagePad. The result is a perfect picture.

Note: I was under the impression that CloudDeploy didn't produce the stitching artifacts but it also does when grid with pictures is mixed.

the ImageAssembled picture is 1 big picture while the Grid solution contains 9 individual pictures. So my question is if it is possible to mix Grid and Images without stitching errors or is it impossible to mix. Do I gain load time of the page with this?

I don't have the means (I think) to cloud deploy. When I just export the image to my desktop, I see no lines.

However, you might try applying the Background option to Grid[], rather than the plots. This should make the problem go away. I encountered similar problems, and this change fixed them.

David, your picture has the white line at the top.

enter image description here

The white line is in the picture. I checked by downloading in firefox, IE and chrome. In firefox it is easy to see because of the black background. MMA 10.3 win 8.1 64

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