1
$\begingroup$

Suppose that I have plotted many figures and have exported them as images. Now for the post-processing phase, I would like to import these figures and manipulate them in such a way that a slider assists me to view them together. The plots are produced by changing just one parameter. Thus I would like to put the name of this parameter on the slide as well as its range. Does anyone have experience for such manipulation?

Thanks in advance

$\endgroup$

1 Answer 1

2
$\begingroup$

First I will create some files to reproduce what you have

SetDirectory[$TemporaryDirectory];
SetDirectory@CreateDirectory["TestPictures"]; *)

Export[
   StringJoin[
    #[[2]]
    , ".png"
    ]
   , ImageResize[
    ExampleData[#]
    , 100
    ]
   ] & /@ Take[
  ExampleData["TestImage"]
  , 5
  ]

Now we can use the Slider in Manipulate.

With[{picturefiles = FileNames["*.png"]},
 Manipulate[
  Column[
   {
    picturefiles[[k]],
    Import[picturefiles[[k]]]
    }
   ]
  , {{k,1,"Index"}, 1, Length[picturefiles], 1}
  ]
 ]

enter image description here

Without Slider but SetterBar, in this case better.

With[{picturefiles = FileNames["*.png"]},
 Manipulate[
  Import[k]
  , {{k, picturefiles[[1]], "File"}, picturefiles, SetterBar, 
   Appearance -> "Vertical"}
  ]]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks for your answer. Is it possible to change the name of the slider and also show its range on the slider? $\endgroup$
    – KratosMath
    Jun 2, 2018 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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