On Wed, Jan 13, 2010 at 12:51:13PM -0800, Alan Irwin wrote: > On 2010-01-13 16:15+0100 Alain Baeckeroot wrote: > > > Hi > > > > I would like to draw a box containing the legend of the graph, in a box > > with semi transparent background. So i need to know the lenght > > (in pixel or win coordinates) of the string, in order to size the box. > > > > I tried `lenght = number_of_char(text) * 8 + 30; # pixels` > > which does not work because the font is not fixed-width > > > > Is there a way to do do this ? > > Hi Alain: > > This is a most interesting topic. > > As I recall, the high-level octave interface does have some legend > functionality (you might want to take a look at its use in the "p" > examples), but it has never worked very well because of the issue of string > size. Would you be willing to try implementing some pllegend capability in C > to see how well plstrl (mentioned by Arjen) satisfies the string-size > requirements of pllegend? > > Once we have a satisfactory pllegend implemented for our core C library, > then it is straightforward to propagate it to all our languages including > octave. That is also true of plstrl if there is any need for it beyond its > internal use by the C version of pllegend. > > My own feeling is that plstrl should give accurate results for our older > drivers (e.g., xwin) that use Hershey fonts. However, that accuracy might > be as much as say 30 per cent off for our modern devices that use a large > variety of different TrueType fonts accessible on various user platforms. > So initially pllegend should probably be conservative about relying on the > accuracy of the results from plstrl. Later on, it might be possible to > upgrade plstrl to interrogate our various modern devices for the potential > plotted size of the string argument to plstrl. But we can deal with that > issue later, and the interesting issue now is implementing a C version of > pllegend that uses plstrl internally to estimate the plotted size of > strings. > > Alain, if you don't have the needed C skills and/or time to implement > pllegend in C, let us know, and hopefully someone else will volunteer.
This would be good to see. It has long been on my wish-list. Ideally I would like to see an interface that supports colourbar support used for filled contour plots for example as well as a key for identifying different line / symbol styles. Alain, if you need any assistance I'll try and help you out. I'd suggest the first stage is to decide on a suitable interface for this. I'd also suggest moving further discussion to the plplot-devel list. Andrew ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Plplot-general mailing list Plplot-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-general