MathGroup Archive 2007

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

Search the Archive


  • To: mathgroup at
  • Subject: [mg76612] Zoom
  • From: dh <dh at>
  • Date: Thu, 24 May 2007 06:22:55 -0400 (EDT)


unfortunately there is still no Zoom function for 2D graphics in version 

6. Well, I tried to roll my own, here is it, please try it out.

It still needs some improvements. I did not manage to localize the 

dynamic variables p1,p2. As soon as I enclose them in a a Module or 

DynamicModule block, they are no more active. Has anybody an idea?

Further, there is a white highlighted region that disapears as soon as 

the cursor move over it. How to eliminate this region?

The function takes as input either a graphics object or the output from 

NotebookRead. The idea is to create a button by e.g.:


You may e.g. put this button in a palette.

Now, select some 2D graphics like e.g. the output of Plot and click the 

button with the graphics still selected. A new document is now created 

showing two graphics. The first one is the original graphics with two 

movable locators, the second one corresponds to the rectangle defined by 

the two locators in the first pane.

Here is the code:








g1=Show[g,PlotRange->Dynamic[Transpose[{p1,p2}]],Frame->True ];




Button["Close",NotebookClose[SelectedNotebook []]]



have fun, Daniel

  • Prev by Date: Re: Mathematica 6.0 easier for me ... (small review)
  • Next by Date: Re: Re: Dialogs and inheritance
  • Previous by thread: Re: Mathematica 6.0 easier for me ... (small review)
  • Next by thread: Grid