MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Eliminate white border around DensityPlot?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg75207] Re: [mg75156] Eliminate white border around DensityPlot?
  • From: "Chris Chiasson" <chris at chiasson.name>
  • Date: Fri, 20 Apr 2007 00:42:36 -0400 (EDT)
  • References: <200704180912.FAA08761@smc.vnet.net>

Here you are:

(MMA 5.2 Kernel) In[1]:=
g1=Show@Insert[
      Graphics@Block[{$DisplayFunction=Identity},
          DensityPlot[Cos[x+y],{x,0,1},{y,0,1},PlotPoints->50,
            Frame\[Rule]False]],PlotRange\[Rule]{{0,1},{0,1}},2]

(MMA 5.2 Kernel) In[2]:=
Show[GraphicsArray[{g1,g1},GraphicsSpacing\[Rule]0]]

Back story (may not be correct, but I think it is):

One reason this workaround is needed is that Mathematica's plotting
routines will add a border around any graphics primitive unless the
containing Graphics object has a non-Automatic PlotRange option.

Also, Graphics ignores directives like PlotRange when converting
ContourGraphics objects, meaning one must add (or modify) the
PlotRange after the conversion to regular graphics objects.

On 4/18/07, AES <siegman at stanford.edu> wrote:
> I want to combine multiple frameless (i.e., Frame->False) DensityPlots
> in a GraphicsArray with no gap or white space between individual plots,
> and with certain features in the individual plots lining up where the
> plots meet.
>
> Using GraphicsSpacing->{0,0} doesn't do it; the individual density plots
> seem to have a white border around them.  GraphicsSpacing->{-0.1,0.1}
> comes close to what I want, but with some odd features.
>
> Any way to eliminate the white border?  [I know about the alternative
> way to combine graphics using Show[Graphics{Rectangle[-],...}]], but
> haven't gotten to trying it yet.)
>
>


-- 
http://chris.chiasson.name/


  • Prev by Date: Re: Importing and retaining graphics
  • Next by Date: Updated BiokmodWeb, the web version of BIOKMOD
  • Previous by thread: Eliminate white border around DensityPlot?
  • Next by thread: errors of NonlinearRegress