On 2017-05-26 05:11-0000 Sergej Scherbina wrote:

How to use plstring instead of plpoin if in plstring I must use
unknown specific string sign here "", it is not clear code as number?

Hi Sergey:

Please build standard example 00 and run it, but replace
(in the C version of that example)

#define NSIZE 101

by

#define NSIZE 10

and replace

plline(NSIZE, x, y);

by

plstring(NSIZE, x, y, "+");

I haven't tried this for myself, but if I made no typographical errors
above, you should get a 10 point plot with the ascii glyph "+" at
each of the points.  And if you just want to plot a single glyph
at a single point, then use one-element arrays for x and y,

The most important point concerning plstring, is for modern devices
such as pdfqt or pdfcairo, all of UTF-8 is available to you rather
than just the ascii subset of that unicode encoding.  For example, if
you have an editor (such as emacs) with cut and paste capability for
UTF-8 glyphs you can simply cut and paste the desired plotting symbol
from any website e.g.,
<https://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode>
or (on Linux and Cygwin but not MinGW-w64/MSYS2 platforms) directly
from the extraordinarily useful gucharmap system font browser
application.  Furthermore, if cut and paste doesn't work for UTF-8
glyphs for you, then you can fall back to accessing unicode glyphs via
their PLplot unicode encoding (see
<http://plplot.sourceforge.net/docbook-manual/plplot-html-5.12.0/characters.html#escape-sequences>
for details about that encoding).

So to take a concrete example, suppose the unicode symbol you choose is the

bullet operator = "∙" = U+2219.

You can plot that glyph using cut and paste, e.g.,

plstring(NSIZE, x, y, "∙");

which should make clear (if your mailer is UTF-8 aware) to you what
glyph will be plotted when reading this e-mail, and similarly if your
editor is UTF-8 aware, the code will also be clear.  But if
cutting and pasting of UTF-8 glyphs like I have described
does not work on your platform, then you can
always fall back to using the PLplot unicode encoding as follows:

plstring(NSIZE, x, y, "#[0x2219]");

where the relationship between U+2219 for the bullet operator glyph
and the above PLplot unicode character escape sequence for that glyph
is pretty obvious.  However, the glyph that will be plotted is not
immediately obvious if you use this method so this method is not
recommended if cut and paste works for you.

I hope these remarks and also your reading of our documentation of
character rendering at <http://plplot.sourceforge.net/docbook-manual/plplot-html-5.12.0/characters.html>
will help you to understand what I have said above. However, if not,
keep asking more questions on this list since those questions and
responses to them should be interesting for all PLplot users who are
reading this e-mail now and also those who search the PLplot
mailing-list archives for answers in the future.

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); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); 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
__________________________

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Plplot-general mailing list
Plplot-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-general

Reply via email to