Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'm trying to create a manipulate controller to set four value. High and low temperature for both test and use conditions. The four values then go into a calculation.

I can set these as four individual sliders - which takes quite a bit of room.

I did find this code


    Manipulate[
Column[{Dynamic@
Grid@Map[Pane[#, {60, 12}] &, 
  Transpose@points, {2}]}], {{points, ({#, 0} &) /@ 
Round[RandomReal[{-2, 2}, {4}], .001]}, 
LocatorPane[Dynamic[points, (points = {#, 0} & /@ First /@ #) &], 
Graphics[{}, PlotRange -> {{-2, 2}, {-.1, .1}}, Axes -> True, 
 ImageSize -> 300, Ticks -> {Automatic, None}], 
Appearance -> 
 Graphics[{EdgeForm[Gray], LightGray, Disk[]}, 
  ImageSize -> 10]] &}]

at

Manipulating several values from the same interval

So, my question is on labeling each of the points so they are unique to each of the four temperature values?

I'd also like to pre assign values and keep the values created for use in calculations later in the manipulate.... is this possible?

I think I need to get rid of the Random assignment of the five point, change it to four specific points, and that is where I get los on how to assign the results of someone moving the points to a variable.

Guess two or three questions here.

share|improve this question
    
Like this one? reference.wolfram.com/language/ref/IntervalSlider.html If you look at Custom Control Appearances on this page it'll help you implement new controls. –  Szabolcs Feb 23 at 4:59
    
@Fred You've been a member of this site for a year now, and posted 8 questions. But you accepted only one answer and also voted only once. That perhaps shows that your experience hasn't been good so far. Care to comment why? –  belisarius Feb 23 at 18:06
    
Hi Belisarius,Mostly just struggling to learn MMA - and get a few projects accomplished. I should pay more attention to the procedures here as the site has been very helpful and supportive. For example, not even sure how to add a line break to a comment here --- I do appreciate your support and if voting or accepting answers helps others know they are on the right track - I'll pay more attention in the future. First though I need to learn more about this valuable forum. Cheers, Fred –  Fred Schenkelberg Feb 25 at 8:09
add comment

1 Answer 1

You could label the points:

Manipulate[
 Column[{Dynamic@
    Grid@Map[Pane[#, {60, 20}] &, 
      Transpose@points, {2}]}], {{points, ({#, 0.1} &) /@ {-1, -1.5, 1.5, 1}},
  LocatorPane[
    Dynamic[points, (points = {#, 0.1} & /@ First /@ #) &], 
    Graphics[{}, PlotRange -> {{-2, 2}, {-.5, .5}}, 
     AxesOrigin -> {0, 0}, Axes -> True, ImageSize -> 300, Ticks -> {Automatic, None}], 
    Appearance -> (Labeled[
         Graphics[{EdgeForm[Gray], LightGray, Disk[]}, 
          ImageSize -> 10], #, Top] & /@ {uh, ul, th, tl})] &}]

Mathematica graphics

share|improve this answer
    
Nice implementation +1. I was wondering if it is possible to restrict the high bound not to be left of the lower bound (maybe carrying them as they move ...) and the reverse (lower to upper) –  tchronis Feb 23 at 8:19
    
That's a great idea - in my application that should be the case anyway - it would provide an error proof in the document. I would also like to use the point to do a calculation. So would I replace the -1, -1.5, 1.5, 1 in the Grid@Map[... with variables that I then can use later in a calculation? –  Fred Schenkelberg Feb 23 at 17:19
    
@tchronis 1) Its nice, but not mine. I borrowed most of the code from the docs :) 2) To impose individual restrictions on the bounds it's better to define four independent locators instead of an array –  belisarius Feb 23 at 18:00
    
@FredSchenkelberg You asked "I'd also like to pre assign values and keep the values created for use in calculations later in the manipulate.... is this possible?" Your above comment requires now a different thing, and I think it has been asked before. Search the site –  belisarius Feb 23 at 18:03
    
@belisarius - thanks, I've been looking and it's the code within the Grid and LocatorPane lines that I'm not at all familiar with thus not sure how to edit. I have found ways to define variable with preset values within the controller or slider - not within the above array -- that part has me stumped. –  Fred Schenkelberg Feb 23 at 18:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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