On 2008-07-16 11:11+0800 Paul Harris wrote:

> Hi,
>
> I'm new to plplot.  I'd like to utilise plplot to generate charts in my 
> program.
>
> I would like to be able to plot points as circles, lines or whatever,
> and then be able to click on those markers and display additional info
> elsewhere in my application.
>
> Has anyone done this?
>
> I would be getting the mouse click from the GUI (QT) and then either
> passing it to plplot, or use some other mechanism to be able to map
> that mouse coord to a marker.
>
> I don't see anything obvious in the docs or the code... so I was
> thinking about how I'd do it.
>
> One way would be to write a driver that goes through the motions of
> pretending to draw a chart, but instead is able to match up a mouse
> coord to the markers that it is told to draw...
>
> so, has anyone done something like this?

The core of PLplot supports interactive capability for those drivers
that have it implemented.

Our xwin device has interactive capability where you can display
cross-hairs, move them around, and when a key is clicked, deliver the
position of the crosshairs and the identity of the key which was clicked.
To see this capability in action try the -locate option for C example 1 with
-dev xwin.  -dev wxwidgets has similar capability, although I could only get
the return key to work at this time.  I think there is a plan to implement at
least the level of xwin capability in the xcairo device.  For example, you
get some hits when you grep for "cross" in the cairo code.  However, I
couldn't get it to work (no crosshairs were displayed with example 1 when
the -locate option was used.)

Anyhow, you could use these interactive capabilities for a start for
doing something more interesting.  You may want to work with -dev wxwidgets
or -dev xcairo since both have modern font capabilities while xwin does
not.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plplot-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-general

Reply via email to