Vadim Zeitlin wrote:
> I'm looking into the possibility of using plplot for a project I'm working
> on and would like to ask for your collective wisdom about whether it's
> going to be a good match for it. The reason for asking this is that there
> are 2 things which I need to do in this project which don't seem to be
> supported by plplot currently and I'd like to know whether you think it's
> going to be reasonably simple to add support for them -- and also if you'd
> be interested in adding them to plplot. And, of course, also if I'm just
> missing something and if what I'm looking for is already possible, which
> would be the ideal answer :-)
> The first of these things is the display of so-called candlestick graphs:
> This genuinely doesn't seem to be supported as it was requested before:
> but nothing seems to have happened since then. So the question here is
> mostly how realistic would it be for someone knowing nothing about plplot
> internals to implement support for this new graph kind, either inside or
> outside of plplot itself and if the project maintainers would be interested
> in adding support for candlestick plots to plplot itself (which will give
> me the excuse for asking many more questions) and, generally speaking, if
> anybody has any advice about implementing this.
Now that it has come up twice we might be more interested :). Probably
the first thing would be implement a C function that could create the
graph that you wanted. This would likely be done with a number of plline
()/plfill() function calls to draw each point. Then after you've used it
a bit and think that you have the right function interface we could
likely add it to the project. I think it hasn't happened so far because
no one has offered an implementation, and it is not that we are opposed
to these kinds of plots in general.
> The second thing is that I'd like to have some degree of interactivity.
> E.g. I need to allow the user to click on the y axis to draw a marker at
> the given position (and then to remove it, maybe drag it around and so on).
> I'll be using wxWidgets driver so I'd be able to draw everything I need on
> top of the plplot output but I also need some cooperation from plplot to
> translate the (pixel) coordinates in the window to the graph elements, e.g.
> I need to translate them to the values on the axes. Is this already
> possible and I just didn't find how to do it? If not, do you have any ideas
> about how anything like this could be implemented?
Most of the interactive drivers support basic interactivity with the
function plGetCursor(). There isn't much in the documentation about how
to use this function, but it does return, among other things, where the
user clicked in plot in terms of axis values.