MathGroup Archive 2007

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

Search the Archive

Re: Manipulate is sluggish?

With gratitude, I am forwarding a solution to my problem that seems  
to have reached me but not the rest of the group.

When responding, please replace news with my first initial and full  
last name, as one word.

Tom Burton

 From my first post, "Manipulate is sluggish":

> I'll soon need to work in CMYK colors and also will want to use the  
> new Manipulate expressions to visualize functions of 4 and 5  
> variables. I decided to try a bit of both, first defining a  
> conversion from CMYK to RGB,
> cmyk2rgb[c_,m_,y_,k_]:=(1-k){1-c,1-m,1-y}
> and then comparing the two color systems:
> Manipulate[GraphicsGrid[Table[c=xx/12;m=yy/12;Graphics[{CMYKColor 
> [c,m,y,k],Disk[{xx,yy},1,{0,\[Pi]}],RGBColor@@cmyk2rgb[c,m,y,k],Disk 
> [{xx,yy},1,{\[Pi],2\[Pi]}]},ContentSelectable->False],{xx,0,12,2}, 
> {yy,0,12,2}]],{y,0.0,1,1/6},{k,0.0,1,1/6}]
> .. The resulting dynamic graphic is sluggish. ...

Hi Tom,

Note that because you reevaluate c and m, Manipulate keeps spinning all
the time. Here's a faster version:

DynamicModule[{gr, c, m, y, k},
  gr = GraphicsGrid[Table[c = xx/12; m = yy/12;
     Graphics[{CMYKColor @@ Dynamic /@ {c, m, y, k},
       Disk[{xx, yy}, 1, {0, Pi}],
       RGBColor @@ Dynamic /@ cmyk2rgb[c, m, y, k],
       Disk[{xx, yy}, 1, {Pi, 2 Pi}]},
      ContentSelectable -> False],
     {xx, 0, 12, 2}, {yy, 0, 12, 2}]];
  Manipulate @@ {gr, {y, 0.0, 1, 1/6}, {k, 0.0, 1, 1/6}}

Best regards,
Maxim Rytin

  • Prev by Date: Re: Geocoding using Mathematica
  • Next by Date: Re: A problem with FindRoot
  • Previous by thread: Re: Manipulate is sluggish?
  • Next by thread: Trying to create a clustered StackedBarChart