Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6345153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:46:01+00:00 2026-05-24T20:46:01+00:00

I am trying to have two panels, the left showing a graphic and two

  • 0

I am trying to have two panels, the left showing a graphic and two locators, the right one a zoomed-in version in the area defined by the locators.

I’ve tried

ClearAll[mndpt];
mndpt = Compile[{{c, _Complex}, {maxiter, _Integer}},
   Module[{z, iters},
        iters = 0.;
        z = c;
            While[(iters < maxiter) && (Abs@z < 2),
                iters++;
                z = z^2 + c];
        Sqrt[iters/maxiter]],
   {{z, _Complex}},
   CompilationTarget \[Rule] "C",
   RuntimeOptions \[Rule] "Speed"];

and do

Manipulate[
 Grid[
  {{DensityPlot[mndpt[x + y*I, 200],
        {x, -2, 1}, {y, -1.5, 1.5},
        PlotRange \[Rule] {0, 1}, PlotPoints \[Rule] 80, 
     ColorFunction \[Rule] "Rainbow"],
    DensityPlot[mndpt[x + y*I, 200],
        Dynamic@{x, p1[[1]], p2[[1]]}, Dynamic@{y, p1[[2]], p2[[2]]},
        PlotRange \[Rule] {0, 1}, PlotPoints \[Rule] 80, 
     ColorFunction \[Rule] "Rainbow"]}}],
 {{p1, {-1, -1}}, Locator}, {{p2, {0, 1}}, Locator}]

The right panel does not then work:
enter image description here

My question is, why is this so? As you can see, it complains that “DensityPlot::pllim: Range specification {x,-1,0} is not of the form {x, xmin, xmax}. ” which I find puzzling. In fact I am generally puzzled. What is going on? Some sort of scoping issue? Evaluation issue? And how can I get it to work? This is probably simple, but I never really understood this frontend stuff.

EDIT: It turns out that this question was due to a (hopefully momentary) sharp increase in stupidity on my part. As pointed out by Simon in a comment, removing the two Dynamics
(which I had added in a blind effort to make this work) makes everything work fine. That is,

    Manipulate[
 Grid[
  {{DensityPlot[mndpt[x + y*I, 200],
        {x, -2, 1}, {y, -1.5, 1.5},
        PlotRange \[Rule] {0, 1}, PlotPoints \[Rule] 80, 
     ColorFunction \[Rule] "Rainbow"],
    DensityPlot[mndpt[x + y*I, 200],
        {x, p1[[1]], p2[[1]]},{y, p1[[2]], p2[[2]]},
        PlotRange \[Rule] {0, 1}, PlotPoints \[Rule] 80, 
     ColorFunction \[Rule] "Rainbow"]}}],
 {{p1, {-1, -1}}, Locator}, {{p2, {0, 1}}, Locator}]

does the right thing:

enter image description here

So, who knows why else I did the first few times so that it didn’t work.

On the other hand, the message in the original case, namely, “DensityPlot::pllim: Range specification {x,-1,0} is not of the form {x, xmin, xmax}. ” was more puzzling. I think it’s been explained by Leonid, also in a comment (in brief, try ClearAttributes[Dynamic, ReadProtected] then ??Dynamic and you can see that there is a definition Dynamic/:MakeBoxes[BoxForm`x$_Dynamic,StandardForm]:= etc). As my understanding of frontend programming is negligible I won’t try to explain it here, so if anybody does post an answer explaining that, it would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:46:02+00:00Added an answer on May 24, 2026 at 8:46 pm

    As discussed in the comments to the question, the code works fine if the Dynamics are removed from the ranges in the second DensityPlot. The Dynamics are not normally needed in the body of a Manipulate as it is automatically wrapped in a dynamic construct. Although, for a more fine grained control of which parts of an expression update, it can be useful to use Dynamic inside of a Manipulate.

    The reason an error was created was because the range of a plot should be of the form {x, xmin, xmax} with x a Symbol and xmin and xmax numeric. Wrapping Dynamic around the list changes the head and breaks the plot.

    The reason that the error was not obvious to spot is because the error message was a little confusing:

    Range specification {x,-1,0} is not of the form {x, xmin, xmax}.

    Which, on the surface looks crazy, but makes sense once you realise (as pointed out by Leonid) that Dynamic is a wrapper that has a MakeBoxes definition that makes it invisible when outputted to the notebook. To see this, look at

    In[1]:= FormatValues[Dynamic]
    Out[1]= {HoldPattern[MakeBoxes[BoxForm`x$_Dynamic, StandardForm]] :> (DynamicModule; 
               DynamicDump`ControlToBoxes[BoxForm`x$, StandardForm]), 
            <<snip: same but for TraditionalForm>>}
    

    and ControlToBoxes in turn, creates a DynamicBox object. This can also be seen by entering Dynamic[x] and using the cell menu or shortcut to Show Expression of the produced output cell – you can also look at the underlying expression of the error message and see the DynamicBox construction there. It’s also possible to Unprotect and remove the MakeBoxes definition of Dynamic, but that breaks most of the dynamic functionality in Mathematica…


    Finally, here’s my version of the code:

    mndpt = Compile[{{c, _Complex}, {maxiter, _Integer}},
       Module[{z = c, iters = 0.0},
        While[(iters < maxiter) && (Abs@z < 2), iters++; z = z^2 + c];
        Sqrt[iters/maxiter]], CompilationTarget -> "C", 
       RuntimeOptions -> "Speed"];
    
    opts = Sequence[PlotPoints -> 80, ColorFunction -> "Rainbow", 
       ImageSize -> Medium, ImagePadding -> {{30, 5}, {20, 5}}];
    
    fixed = DensityPlot[mndpt[x + y*I, 200], {x, -2, 1}, {y, -1.5, 1.5}, 
       PlotPoints -> 120, Evaluate[opts]];
    
    Manipulate[Grid[{{fixed, DensityPlot[mndpt[x + y*I, 200],
       {x, p[[1, 1]], p[[2, 1]]}, {y, p[[1, 2]], p[[2, 2]]}, Evaluate[opts]]}}],
     {{p, {{-1, -1}, {0, 1}}}, Locator, ContinuousAction -> False}]
    

    output of the above

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to have two submit buttons in my form - one accepts
I am trying to have two data series plotted in one graph as boxes
I have two arrayLists and I am trying to subtract one arrayList from another.
I have two arrays of data that I'm trying to amalgamate. One contains actual
I have added two update panels to my page. I'm trying to update the
My main form has two panels, left docked and right docked. The right side
i have two update panels as follows (when linkbutton is clicked i'm trying to
i have two tables i am trying to get information from. login table -
I have two PNGs that I am trying to combine into a PDF using
I have two very similar programs each trying to run two threads OddThread and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.