How do you create draggable points inside a graphic image?Real Size Image PrintingCan individual locators in LocatorPane be temporarily disabled?Interactive graphics without creating a new cellHow to feed parameters obtained from direct 3D manipulation back into Manipulate's controls?Narrow a Drawing Tools WindowTracing an image to produce a vector graphicSpeed Up Sampling of Perimeter of Polygonexport video of dynamic graphics in complex manipulate interfaceHow to prerender / rasterize a graphic without losing location informationHow do you glue a text to a point?

The monorail explodes before I can get on it

What's the minimum number of sensors for a hobby GPS waypoint-following UAV?

How can an advanced civilization forget how to manufacture its technology?

Why did my rum cake turn black?

Novel where a group of scientists in a spaceship encounter various aliens

Is Arc Length always irrational between two rational points?

Why would guns not work in the dungeon?

How can I get a player to accept that they should stop trying to pull stunts without thinking them through first?

What do the horizontal lines in a P-V phase diagram mean?

Did any of the founding fathers anticipate Lysander Spooner's criticism of the constitution?

During copyediting, journal disagrees about spelling of paper's main topic

Can I call 112 to check a police officer's identity in the Czech Republic?

Cubic programming and beyond?

How do Windows version numbers work?

What is this welding tool I found in my attic?

Referring to different instances of the same character in time travel

CentOS 7 -> find: missing Argument for "-exec"

How to hide what's behind an object in a non destructive way / give it an "invisibility cloak"

Matchmaker, Matchmaker, make me a match

How did the hit man miss?

Supporting developers who insist on using their pet language

Is lack of functional requirements agile?

Why does the autopilot disengage even when it does not receive pilot input?

Simple LED driver, transistor and GPIO



How do you create draggable points inside a graphic image?


Real Size Image PrintingCan individual locators in LocatorPane be temporarily disabled?Interactive graphics without creating a new cellHow to feed parameters obtained from direct 3D manipulation back into Manipulate's controls?Narrow a Drawing Tools WindowTracing an image to produce a vector graphicSpeed Up Sampling of Perimeter of Polygonexport video of dynamic graphics in complex manipulate interfaceHow to prerender / rasterize a graphic without losing location informationHow do you glue a text to a point?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2












$begingroup$


I want to create a simple line with two points that can be dragged (one at a time), as in image below:



enter image description here



How can I do that without using sliders, but rather dragging the points themselves. I suspect that one uses Manipulate and Graphics in some fashion but I am not sure.










share|improve this question











$endgroup$


















    2












    $begingroup$


    I want to create a simple line with two points that can be dragged (one at a time), as in image below:



    enter image description here



    How can I do that without using sliders, but rather dragging the points themselves. I suspect that one uses Manipulate and Graphics in some fashion but I am not sure.










    share|improve this question











    $endgroup$














      2












      2








      2





      $begingroup$


      I want to create a simple line with two points that can be dragged (one at a time), as in image below:



      enter image description here



      How can I do that without using sliders, but rather dragging the points themselves. I suspect that one uses Manipulate and Graphics in some fashion but I am not sure.










      share|improve this question











      $endgroup$




      I want to create a simple line with two points that can be dragged (one at a time), as in image below:



      enter image description here



      How can I do that without using sliders, but rather dragging the points themselves. I suspect that one uses Manipulate and Graphics in some fashion but I am not sure.







      graphics interactive






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 7 hours ago









      Somos

      2,8301 gold badge2 silver badges11 bronze badges




      2,8301 gold badge2 silver badges11 bronze badges










      asked 8 hours ago









      Bob UelandBob Ueland

      5292 silver badges14 bronze badges




      5292 silver badges14 bronze badges




















          3 Answers
          3






          active

          oldest

          votes


















          3












          $begingroup$

          Manipulate[
          Graphics[Line[pt1, pt2], PlotRange -> 2], pt1, 0, 0,
          Locator, pt2, 0, 1, Locator]





          share|improve this answer









          $endgroup$




















            5












            $begingroup$

            Here is how you would do it with LocatorPane:



            pt1 = 0, 0;
            pt2 = 0, 2;
            LocatorPane[
            Dynamic[pt1, pt2],
            Dynamic@Graphics[
            Line[pt1, pt2]
            ,
            PlotRange -> -5, 5, -5, 5
            ],
            Appearance ->
            Graphics[Red, PointSize[Large], Point[0, 0]],
            Graphics[Blue, PointSize[Large], Point[0, 0]]

            ]


            enter image description here






            share|improve this answer









            $endgroup$




















              2












              $begingroup$

              You can also use a single control for multiple locators:



              Manipulate[Graphics[Line[pts], PlotRange -> 2], 
              pts, 0, 0, 1, 1, Locator, Appearance -> (Style["●", #, 16] & /@ Red, Green)]


              enter image description here






              share|improve this answer









              $endgroup$















                Your Answer








                StackExchange.ready(function()
                var channelOptions =
                tags: "".split(" "),
                id: "387"
                ;
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function()
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled)
                StackExchange.using("snippets", function()
                createEditor();
                );

                else
                createEditor();

                );

                function createEditor()
                StackExchange.prepareEditor(
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: false,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: null,
                bindNavPrevention: true,
                postfix: "",
                imageUploader:
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                ,
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                );



                );













                draft saved

                draft discarded


















                StackExchange.ready(
                function ()
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f201942%2fhow-do-you-create-draggable-points-inside-a-graphic-image%23new-answer', 'question_page');

                );

                Post as a guest















                Required, but never shown

























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                3












                $begingroup$

                Manipulate[
                Graphics[Line[pt1, pt2], PlotRange -> 2], pt1, 0, 0,
                Locator, pt2, 0, 1, Locator]





                share|improve this answer









                $endgroup$

















                  3












                  $begingroup$

                  Manipulate[
                  Graphics[Line[pt1, pt2], PlotRange -> 2], pt1, 0, 0,
                  Locator, pt2, 0, 1, Locator]





                  share|improve this answer









                  $endgroup$















                    3












                    3








                    3





                    $begingroup$

                    Manipulate[
                    Graphics[Line[pt1, pt2], PlotRange -> 2], pt1, 0, 0,
                    Locator, pt2, 0, 1, Locator]





                    share|improve this answer









                    $endgroup$



                    Manipulate[
                    Graphics[Line[pt1, pt2], PlotRange -> 2], pt1, 0, 0,
                    Locator, pt2, 0, 1, Locator]






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered 8 hours ago









                    Rohit NamjoshiRohit Namjoshi

                    1,9871 gold badge4 silver badges16 bronze badges




                    1,9871 gold badge4 silver badges16 bronze badges























                        5












                        $begingroup$

                        Here is how you would do it with LocatorPane:



                        pt1 = 0, 0;
                        pt2 = 0, 2;
                        LocatorPane[
                        Dynamic[pt1, pt2],
                        Dynamic@Graphics[
                        Line[pt1, pt2]
                        ,
                        PlotRange -> -5, 5, -5, 5
                        ],
                        Appearance ->
                        Graphics[Red, PointSize[Large], Point[0, 0]],
                        Graphics[Blue, PointSize[Large], Point[0, 0]]

                        ]


                        enter image description here






                        share|improve this answer









                        $endgroup$

















                          5












                          $begingroup$

                          Here is how you would do it with LocatorPane:



                          pt1 = 0, 0;
                          pt2 = 0, 2;
                          LocatorPane[
                          Dynamic[pt1, pt2],
                          Dynamic@Graphics[
                          Line[pt1, pt2]
                          ,
                          PlotRange -> -5, 5, -5, 5
                          ],
                          Appearance ->
                          Graphics[Red, PointSize[Large], Point[0, 0]],
                          Graphics[Blue, PointSize[Large], Point[0, 0]]

                          ]


                          enter image description here






                          share|improve this answer









                          $endgroup$















                            5












                            5








                            5





                            $begingroup$

                            Here is how you would do it with LocatorPane:



                            pt1 = 0, 0;
                            pt2 = 0, 2;
                            LocatorPane[
                            Dynamic[pt1, pt2],
                            Dynamic@Graphics[
                            Line[pt1, pt2]
                            ,
                            PlotRange -> -5, 5, -5, 5
                            ],
                            Appearance ->
                            Graphics[Red, PointSize[Large], Point[0, 0]],
                            Graphics[Blue, PointSize[Large], Point[0, 0]]

                            ]


                            enter image description here






                            share|improve this answer









                            $endgroup$



                            Here is how you would do it with LocatorPane:



                            pt1 = 0, 0;
                            pt2 = 0, 2;
                            LocatorPane[
                            Dynamic[pt1, pt2],
                            Dynamic@Graphics[
                            Line[pt1, pt2]
                            ,
                            PlotRange -> -5, 5, -5, 5
                            ],
                            Appearance ->
                            Graphics[Red, PointSize[Large], Point[0, 0]],
                            Graphics[Blue, PointSize[Large], Point[0, 0]]

                            ]


                            enter image description here







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered 8 hours ago









                            C. E.C. E.

                            53.1k3 gold badges102 silver badges210 bronze badges




                            53.1k3 gold badges102 silver badges210 bronze badges





















                                2












                                $begingroup$

                                You can also use a single control for multiple locators:



                                Manipulate[Graphics[Line[pts], PlotRange -> 2], 
                                pts, 0, 0, 1, 1, Locator, Appearance -> (Style["●", #, 16] & /@ Red, Green)]


                                enter image description here






                                share|improve this answer









                                $endgroup$

















                                  2












                                  $begingroup$

                                  You can also use a single control for multiple locators:



                                  Manipulate[Graphics[Line[pts], PlotRange -> 2], 
                                  pts, 0, 0, 1, 1, Locator, Appearance -> (Style["●", #, 16] & /@ Red, Green)]


                                  enter image description here






                                  share|improve this answer









                                  $endgroup$















                                    2












                                    2








                                    2





                                    $begingroup$

                                    You can also use a single control for multiple locators:



                                    Manipulate[Graphics[Line[pts], PlotRange -> 2], 
                                    pts, 0, 0, 1, 1, Locator, Appearance -> (Style["●", #, 16] & /@ Red, Green)]


                                    enter image description here






                                    share|improve this answer









                                    $endgroup$



                                    You can also use a single control for multiple locators:



                                    Manipulate[Graphics[Line[pts], PlotRange -> 2], 
                                    pts, 0, 0, 1, 1, Locator, Appearance -> (Style["●", #, 16] & /@ Red, Green)]


                                    enter image description here







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered 2 hours ago









                                    kglrkglr

                                    204k10 gold badges233 silver badges463 bronze badges




                                    204k10 gold badges233 silver badges463 bronze badges



























                                        draft saved

                                        draft discarded
















































                                        Thanks for contributing an answer to Mathematica Stack Exchange!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid


                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.

                                        Use MathJax to format equations. MathJax reference.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function ()
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f201942%2fhow-do-you-create-draggable-points-inside-a-graphic-image%23new-answer', 'question_page');

                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        ParseJSON using SSJSUsing AMPscript with SSJS ActivitiesHow to resubscribe a user in Marketing cloud using SSJS?Pulling Subscriber Status from Lists using SSJSRetrieving Emails using SSJSProblem in updating DE using SSJSUsing SSJS to send single email in Marketing CloudError adding EmailSendDefinition using SSJS

                                        Кампала Садржај Географија Географија Историја Становништво Привреда Партнерски градови Референце Спољашње везе Мени за навигацију0°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.340°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.34МедијиПодациЗванични веб-сајту

                                        19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу