0
$\begingroup$

Consider the following .wl package:

BeginPackage["ColorsIn3DPlot`"];


Begin["MyPrivate`"]


CreatePalette[Manipulate[
  Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, ColorFunction -> color,
   ImageSize -> {480, 480}],
  {color, {"Rainbow", "NeonColors", "BlueGreenYellow"}}],
 WindowFloating -> True,
 WindowSize -> All,
 WindowTitle -> "Nice Plot",
 Saveable -> False];


End[];


EndPackage[];

Clicking on ► Run All Code at the top right corner of the so-called "Package Helper" indeed outputs a palette with the 3D graphics, but no interactivity is enabled.

Can anyone point out the reason to why it is so?

$\endgroup$
4
  • $\begingroup$ What version are you using? $\endgroup$ Jul 25 at 16:56
  • $\begingroup$ Version 12.0 on windowd 10. $\endgroup$
    – tush
    Jul 25 at 17:05
  • $\begingroup$ Just tried it once again on Mac OS X, running version 12.2, and still, no 3d interactivity is there. $\endgroup$
    – tush
    Jul 25 at 17:17
  • $\begingroup$ What seems to help is adding the option StyleDefinitions -> "" to CreatePalette, therefore a problem lies in the defaulty Palette.nb style. However, this makes the palette window include the top Wolfram Mathematica bar. $\endgroup$
    – Domen
    Jul 25 at 17:23
2
$\begingroup$

Add WindowClickSelect -> True to CreatePalette.

CreatePalette[
  Manipulate[
   Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, ColorFunction -> color, 
    ImageSize -> {480, 480}], {color, {"Rainbow", "NeonColors", 
     "BlueGreenYellow"}}], WindowFloating -> True, WindowSize -> All, 
  WindowTitle -> "Nice Plot", WindowClickSelect -> True, 
  Saveable -> False];
$\endgroup$
1
  • $\begingroup$ Thanks a lot! So it is not related in any way to the package file. I should change the question title then. $\endgroup$
    – tush
    Jul 25 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.