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: [mg105474] Re: [mg105448] How to make large graphics object fit within a plot?
  • From: "Nasser M. Abbasi" <nma at 12000.org>
  • Date: Fri, 4 Dec 2009 04:32:32 -0500 (EST)
  • References: <21622849.1259839260168.JavaMail.root@n11> <002401ca7420$7a067720$6e136560$@net>
  • Reply-to: "Nasser M. Abbasi" <nma at 12000.org>

hi David;

There seems to be something wrong with the Math newsgroup. I do not remember 
sending the same question again at all. May be some sort of a queue problem.

But thanks for your answers as always I learn something from them.

--Nasser

----- Original Message ----- 
From: "David Park" <djmpark at comcast.net>
To: "'Nasser M. Abbasi'" <nma at 12000.org>; <mathgroup at smc.vnet.net>
Sent: Thursday, December 03, 2009 7:56 AM
Subject: [mg105474] RE: [mg105448] How to make large graphics object fit within a plot?


> Nasser,
>
> I thought you asked that question back on 25 Nov and received a number of
> answers.
>
> In any case, here is a Presentations solution that works straight off
> because Mathematica has access to all the primitives at once.
>
> Needs["Presentations`Master`"]
>
> Draw2D[
> {Draw[Sin[x], {x, 0, 10}],
>  Opacity[.5, Orange],
>  Disk[{5, 0}, 2]},
> Frame -> True]
>
> But, in general, you may have to specify things like PlotRange,
> PlotRangePadding, ImagePadding and other things. The fact that Mathematica
> makes some nice plots with minimal effort leads to a false impression that
> it will make all plots with minimal effort. This is just not the case. 
> Most
> nice plots are going to require a little effort. Some are going to require 
> A
> LOT of effort if you want them to look their best.
>
>
> 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: LayeredGraphPlot Question
  • Next by Date: Re: NDSolve with momentum
  • Previous by thread: Re: How to make large graphics object fit within a plot?
  • Next by thread: Manipulate jitter