help-octave
[Top][All Lists]
Advanced

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

Re: gnuplot, gnuplot/cairo, qt, fltk??


From: Pantxo
Subject: Re: gnuplot, gnuplot/cairo, qt, fltk??
Date: Thu, 2 Jun 2016 02:32:20 -0700 (PDT)

Clinton Winant-2 wrote
> I am trying to come up with a way to draw a 3d arrow (line+ cone tip), and
> label it using greek characters that are properly rendered in a pdf file.
> For the second part, Dmitri showed how to use a cairo GNUTERM to produce
> greek characters that are identical in both the window image as well as
> the
> pdf file.
> 
> The problem is that gnuplot doesn't have a robust hidden line algorithm,
> as
> Ben has pointed out.  This makes it impossible in most cases for gnuplot
> to
> produce an arrow with a conic head as for instance in the following:
> 
> plot3([-1 0.1],[0 0],[0 0],'k','linewidth',2);
> hold on
>                 % cone tip
> scale=0.1;
> n = 20;
> phi = linspace (0, 2*pi, n+1);
> idx = 1:11;% 10 steps along axis of revolution
> [phi, idx] = meshgrid (phi, idx);
> size(phi);% 11 by 21
> z = scale*(idx - 1)/10;%range 0->0.5
> r=scale*(10:-1:0);r = r(idx);%makes r 11 by 21
> [x, y] = pol2cart (phi, r);
> surf (z,x,y);%points toward +x
> text(-1,0.5,0.5,'\theta','fontsize',14)
> colormap(0.9*[1 1 1;1 1 1]);
> 
> 
> I have attached gnuplot-cairo.pdf where the greek character looks
> fantastic, but part of the line is hidden by the cone, and qt.pdf where
> the
> line is fine, but the greek character is not rendered properly.
> 
> _______________________________________________
> Help-octave mailing list

> Help-octave@

> https://lists.gnu.org/mailman/listinfo/help-octave
> 
> 
> gnuplot-cairo.pdf (25K)
> <http://octave.1599824.n4.nabble.com/attachment/4677371/0/gnuplot-cairo.pdf>
> qt.pdf (21K)
> <http://octave.1599824.n4.nabble.com/attachment/4677371/1/qt.pdf>

Another hack to have special characters in opengl based printouts is to use
the "Symbol" (see [1] for the correspondence ascii/symbol) font, which is
the only font with  special characters that  the underlying printing library
supports:

  ...
  te = text(-1,0.5,0.5,'q','fontsize',14, "fontname", "Symbol")
  ...

The text won't probably show on screen and you will get a warning :
  warning: ft_render: skipping missing glyph for character '71'

but the printout will be correct. Obviously, this will work only if the text
string only contains special characters as in this case.

Pantxo

[1] https://en.wikipedia.org/wiki/Symbol_%28typeface%29




--
View this message in context: 
http://octave.1599824.n4.nabble.com/gnuplot-gnuplot-cairo-qt-fltk-tp4677371p4677383.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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