octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

interactively adding text annotations to Qt plots


From: John W. Eaton
Subject: interactively adding text annotations to Qt plots
Date: Thu, 16 Apr 2015 10:19:58 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0

With the following changeset

  http://hg.savannah.gnu.org/hgweb/octave/rev/908b68a98ba6

I sketched out an implementation of handling interactive text annotations in the Qt plotting widget. It seems to work OK but it is limited. There is no way to specify multi-line text, fonts, alignment, colors, etc. Instead of a simple QInputDialog, we need a custom dialog box that allows all the properties for a text annotation object to be set interactively. These are:

  position:

4-element vector [x0, y0, width, height], defaults for x0 and y0 are the position of the mouse click. The width and the height can be anything since "fitboxtotext" is true by default.

  units:

Only use if position is specified. If taking the position from the mouse click coordinates, then use the default "normalized" units.

  backgroundcolor, edgecolor, linestyle, linewidth:

    Customize the box background color and edges appearance.

  font... properties, horizontalalignment, verticalalignment:

    Properties for the text itself.

  fitboxtotext:

Control the size of the box. If "on" (the default) the box limits are fit to the text extent.


I could use some help with creating this dialog. Perhaps there is a simple way to do this job that I'm not aware of? Any help would be greatly appreciated.

jwe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]