|
From: Nils W. <ni...@go...> - 2014-12-11 13:47:56
|
Hi all, how can I create line segments between consecutive selected points of a scatter plot in an interactive manner ? It should be possible to create several unclosed polygonal lines. Each polygonal line might have a different color. A small example is appreciated. Thanks in advance. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/line-segments-in-a-scatter-plot-tp44602.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Benjamin R. <ben...@ou...> - 2014-12-11 14:48:03
|
Nils, Perhaps the rectangle selector might be of use? It defaults to a draw mode of 'box', but you can set it to line so that it looks like a ruler widget. http://matplotlib.org/api/widgets_api.html#matplotlib.widgets.RectangleSelector I can imagine that you could set up a selector callback that could then query the data on the graph to "snap" the final line to the nearest points on the graph, creating a Line2D object on the fly. Is that what you are looking for? Cheers! Ben Root On Thu, Dec 11, 2014 at 8:47 AM, Nils Wagner <ni...@go...> wrote: > > Hi all, > > how can I create line segments between consecutive selected points of a > scatter plot in an interactive manner ? It should be possible to create > several unclosed polygonal lines. Each polygonal line might have > a different color. > > A small example is appreciated. > > Thanks in advance. > > > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/line-segments-in-a-scatter-plot-tp44602.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > > http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Nils W. <ni...@go...> - 2014-12-11 15:39:12
Attachments:
scatter.png
|
Hi Ben, I have attached a sample scatter plot. The task is to add lines to the scatter plot. Nils On Thu, Dec 11, 2014 at 3:47 PM, Benjamin Root <ben...@ou...> wrote: > Nils, > > Perhaps the rectangle selector might be of use? It defaults to a draw mode > of 'box', but you can set it to line so that it looks like a ruler widget. > > http://matplotlib.org/api/widgets_api.html#matplotlib.widgets.RectangleSelector > > I can imagine that you could set up a selector callback that could then > query the data on the graph to "snap" the final line to the nearest points > on the graph, creating a Line2D object on the fly. Is that what you are > looking for? > > Cheers! > Ben Root > > > > On Thu, Dec 11, 2014 at 8:47 AM, Nils Wagner <ni...@go...> > wrote: >> >> Hi all, >> >> how can I create line segments between consecutive selected points of a >> scatter plot in an interactive manner ? It should be possible to create >> several unclosed polygonal lines. Each polygonal line might have >> a different color. >> >> A small example is appreciated. >> >> Thanks in advance. >> >> >> >> >> >> -- >> View this message in context: >> http://matplotlib.1069221.n5.nabble.com/line-segments-in-a-scatter-plot-tp44602.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------------ >> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server >> from Actuate! Instantly Supercharge Your Business Reports and Dashboards >> with Interactivity, Sharing, Native Excel Exports, App Integration & more >> Get technology previously reserved for billion-dollar corporations, FREE >> >> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > |
|
From: Thomas C. <tca...@gm...> - 2014-12-11 16:10:59
|
I would just call use `plot` and keep track of the Line2D objects returned. On Thu Dec 11 2014 at 10:40:05 AM Nils Wagner <ni...@go...> wrote: > Hi Ben, > > I have attached a sample scatter plot. The task is to add lines to the > scatter plot. > > Nils > > > On Thu, Dec 11, 2014 at 3:47 PM, Benjamin Root <ben...@ou...> wrote: > >> Nils, >> >> Perhaps the rectangle selector might be of use? It defaults to a draw >> mode of 'box', but you can set it to line so that it looks like a ruler >> widget. >> http://matplotlib.org/api/widgets_api.html#matplotlib. >> widgets.RectangleSelector >> >> I can imagine that you could set up a selector callback that could then >> query the data on the graph to "snap" the final line to the nearest points >> on the graph, creating a Line2D object on the fly. Is that what you are >> looking for? >> >> Cheers! >> Ben Root >> >> >> >> On Thu, Dec 11, 2014 at 8:47 AM, Nils Wagner <ni...@go...> >> wrote: >>> >>> Hi all, >>> >>> how can I create line segments between consecutive selected points of a >>> scatter plot in an interactive manner ? It should be possible to create >>> several unclosed polygonal lines. Each polygonal line might have >>> a different color. >>> >>> A small example is appreciated. >>> >>> Thanks in advance. >>> >>> >>> >>> >>> >>> -- >>> View this message in context: http://matplotlib.1069221.n5. >>> nabble.com/line-segments-in-a-scatter-plot-tp44602.html >>> Sent from the matplotlib - users mailing list archive at Nabble.com. >>> >>> ------------------------------------------------------------ >>> ------------------ >>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server >>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards >>> with Interactivity, Sharing, Native Excel Exports, App Integration & more >>> Get technology previously reserved for billion-dollar corporations, FREE >>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151& >>> iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >> > ------------------------------------------------------------ > ------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/ > 4140/ostg.clktrk_______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |