[comp.windows.x] Plotting Markers

nancie@hal.CSS.GOV (Nancie Matson) (12/30/89)

I would like to find out if there is an Xlib command
similar to the GKS command gpolymarker.  I have tried
using the XDrawPoints command, but the points that are
plotted to the screen are barely visible.  I was wondering
if there is a way to resize the plotted point, or even
change it's representation to a X, * or even a hollow circle.

I haven't been able to locate anything in the documentation
that would suggest that these capabilities exist, so I would
appreciate it if anyone has tried to do something of a similar
nature.

I have thought of just placing the text symbol for the 'o' to the
screen, but text characters are not centered about an x,y location,
they are merely placed to the right of the specified starting
location. (At least this was the case in GKS...)

Thanx in advance!

nancie
INTERNET: nancie@hal.CSS.GOV

klee@chico.pa.dec.com (Ken Lee) (12/30/89)

In article <210@hal.CSS.GOV>, nancie@hal.CSS.GOV (Nancie Matson) writes:
> I would like to find out if there is an Xlib command
> similar to the GKS command gpolymarker.  I have tried
> using the XDrawPoints command, but the points that are
> plotted to the screen are barely visible.  I was wondering
> if there is a way to resize the plotted point, or even
> change it's representation to a X, * or even a hollow circle.

The graphics facilities in X are somewhat primitive, as X is intended
to be a layer below graphics systems like PHIGS, GKS, or Display
PostScript.  If you're planning to do sophisticated graphics, you're
probably best off getting one of these higher level graphics systems,
built on top of X.  Many vendors sell them (I can recommend one :-)).

If all you need is markers, you can build a marker facility based on X
line segments, circles, pixmaps, images, and/or characters.  Use the
geometry/extents attributes to center/size the markers.  None of these
objects support resizing, moving, or repainting.  You'll have to do
that yourself.

Ken Lee
DEC Western Software Laboratory, Palo Alto, Calif.
Internet: klee@decwrl.dec.com
uucp: uunet!decwrl!klee

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (12/30/89)

    I would like to find out if there is an Xlib command
    similar to the GKS command gpolymarker.

No, there isn't.  You can either use multiple points per marker, or
explicitly draw an X or a hollow circle, or you a text symbol.

    I have thought of just placing the text symbol for the 'o' to the
    screen, but text characters are not centered about an x,y location,
    they are merely placed to the right of the specified starting
    location.

Glyphs aren't centered on the x,y position you specify, but you can
certainly find out the ink width and height of the glyph, and the
baseline, and compute a relative x,y position to achieve centering.