MathGroup Archive 2009

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

Search the Archive

Re: How to make large graphics object fit within a plot?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105273] Re: [mg105250] How to make large graphics object fit within a plot?
  • From: "David Park" <djmpark at comcast.net>
  • Date: Wed, 25 Nov 2009 23:01:40 -0500 (EST)
  • References: <25558540.1259148317957.JavaMail.root@n11>

Nasser,

With Presentations, and in this particular case, you don't run into that
problem.

Needs["Presentations`Master`"]

Draw2D[
 {Draw[Sin[x], {x, 0, 10}],
  Opacity[.5, Orange],
  Disk[{5, 0}, 2]},
 Frame -> True]

The reason that this works is that Mathematica sees all of the graphics
primitives at once and the Disk isn't hidden in another Graphics or in an
Epilog. Nevertheless, in some cases, you may have to use a more explicit
PlotRange because Automatic may not choose what you want.

Notice that in the statement above you don't have to use Epilog or do
graphics level jumping. You just draw one object after another.


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  



From: Nasser M. Abbasi [mailto:nma at 12000.org] 

I am trying to add a disk at some location on top of an existing plot.  So I

use Epilog to add the disk.

But it seems if the disk is larger than the plot image size, it gets chopped

off.  I wanted the whole disk to show.

I tried increasing ImagePadding for the plot, and also ImageMargins, but 
this did not help.

Here is what I tried

Plot[Sin[x], {x, 0, 10}, AspectRatio -> Automatic,
  Epilog -> {Disk[{5, 0}, 2]}]

Show[Plot[Sin[x], {x, 0, 10}, AspectRatio -> Automatic],
  Graphics[Disk[{5, 0}, 2]]]

Show[Plot[Sin[x], {x, 0, 10}, AspectRatio -> Automatic, PlotRange -> 
Automatic],
  Graphics[Disk[{5, 0}, 2]]]

None of the above works. But the below WORKS:

Show[Plot[Sin[x], {x, 0, 10}, AspectRatio -> Automatic, PlotRange -> 
{Automatic,{-3,3}}],
  Graphics[Disk[{5, 0}, 2]]]

So, I had to explicitly make the plot y-axis large enough to accommodate the

disk to make it 'fit'

I wanted to do this automatically. I am sure there is a way. I just thought 
of something, may be I need to look at
Inset[] may be there is something there? which I'll do that next.

--Nasser 





  • Prev by Date: Re: Re: newbie q-n about FinancialData
  • Next by Date: Re: When Wolfram's technical support cannot help
  • Previous by thread: Re: How to make large graphics object fit within a plot?
  • Next by thread: When Wolfram's technical support cannot help