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: Dmitri A. Sergatskov
Subject: Re: gnuplot, gnuplot/cairo, qt, fltk??
Date: Wed, 1 Jun 2016 21:56:19 -0500

On Wed, Jun 1, 2016 at 8:30 PM, Clinton Winant <address@hidden> 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.


 
​There is a hack to get math / greek symbols in the postscript/pdf from fltk (and I assume qt)
backend. You probably would not like it.  It probably would not work nicely in more complicated
cases than your example. With all that, here we go (this is with graphics_toolkit("fltk")):

after your script do:

print("theta1.tex", "-depslatexstandalone")
(you will get two files "theta1.tex" and "theta1-inc.eps")
Open theta1.tex in your favorite text editor (say emacs) and change
\theta to $\theta $

Compile thets1.tex to postscript or pdf with
latex theta1.tex
dvipdf theta1.dvi

enjoy your theta1.pdf
(attached)

Dmitri.
--


Attachment: theta1.pdf
Description: Adobe PDF document


reply via email to

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