Re: Manipulate - discrete values with names + images.



On May 27, 2:14 pm, Karen Bindash <KarenBind...@xxxxxxxxxxxxxx> wrote:
I have two different requirements for Manipulate which I dont see
covered in the Mathematica 6 documentation.

1) First problem.

I'm basically looking for

* A variable to be called 'density'
* The Manipulate control to be labelled with the Greek letter rho.
* Tabs to be labeled "mercuy" and "water"
* Values of density to be 1 or 13.6 depending whether user selects
water (1) or mercury (13.6)

Can this be done?

Manipulate[
myfunction[density],
{{density, 1, "\[Rho]"}, {1 -> "water", 13.6 -> "mercury"}}]


2) Second problem.

I'd like a variable 'vehicle' to have user selectable values of car
and bike. But when 'car' is selected, a picture (car.jpg) is shown,
and if bike is selected, a picture bike.jpg is shown. Is this
possible? Can the contents of the jpeg be stored in the source, so a
binary image does not need to be loaded from disk?

The key option is SaveDefinitions which stores the functions and state
associate in the manipulate without having to execute the code...

car = Import["car.jpg"];
bike = Import["bike.jpg"];

Manipulate[
Switch[type, "car", car, "bike", bike],
{type, {"car", "bike"}}, SaveDefinitions -> True]

I think all of these are on the Manipulate documentation page, but
there are over 100 examples to look through:
http://reference.wolfram.com/mathematica/ref/Manipulate.html

Jon McLoone
http://members.wolfram.com/jonm
.



Relevant Pages

  • Manipulate - discrete values with names + images.
    ... First problem. ... The Manipulate control to be labelled with the Greek letter rho. ... But when 'car' is selected, a picture is shown, ... and if bike is selected, ...
    (sci.math.symbolic)
  • Re: Photoshopping, YES or NO ?
    ... those perennial topics associated with photography ... but if a picture need a little contrast tweak or whatever ... crazy so you manipulate the crap out of it. ...
    (rec.photo.digital)
  • "Get up and dust yourself off" okies :)
    ... write false things about people and manipulate. ... The picture of Alan, with a Big Mac on his t. ... I would imagine that you considered it "cute", ... And last but not least her fantasy about sucking on Jens clit. ...
    (sci.med.diseases.hepatitis)
  • Re: Manipulate - discrete values with names + images.
    ... covered in the Mathematica 6 documentation. ... * The Manipulate control to be labelled with the Greek letter rho. ... I know the documentation shows both of these things ... I was aware of the SaveDefinitions, but the docs dont give any ...
    (sci.math.symbolic)
  • Re: Manipulate - discrete values with names + images.
    ... associate in the manipulate without having to execute the code... ... I was aware of the SaveDefinitions, but the docs dont give any ... Although that is not part of the main documentation. ...
    (sci.math.symbolic)