help-octave
[Top][All Lists]
Advanced

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

Re: plotting symbols, etc


From: david barnes
Subject: Re: plotting symbols, etc
Date: Tue, 06 Mar 2001 18:07:31 +0000
User-agent: Mozilla/5.0 (X11; U; Linux 2.2.16 i686; en-US; m18) Gecko/20001107 Netscape6/6.0

Hi Ben,

that is extremely generous of you!

I shall digest your expo,
whilst I offer some of my own:

I've got some latex-ness happening,
via a similar method, using
        graw("set xlabel \'$ \\beta_{2} $\'\n");
etc, but I suppose I can use
        gset xlabel '$\\beta_{2}$'
which then allows for sprintf voodoo,
eg:
        plot( x(:), y(:), sprintf( ';$\\zeta = $%.2f;', zeta ) );
or:
        eval( sprintf( 'gset title \"$beta_{1} = %.2f $\" ', beta1 ) )

and other goodness ...

then I call 'latexprint ( filename )' to get the goods:
~~~~~~~~~~~
function latexprint(filename)
# latexprint plots a latex-ised figure to a file
# thanks to Teemu Ikonen <address@hidden>
# and others
graw('set terminal latex\n');
graw("set size 1,1\n")
output = sprintf("set output \"%s\"\n", filename);
graw(output);
graw("replot\n");
graw("set size 1,1\n");
graw("set output \"/dev/null\"\n");
graw("set terminal x11\n");

endfunction
~~~~~~~~~~~





Ben Sapp wrote:

david barnes wrote:

Hi all,

I've been trying to add some symbols to titles
but so far not much joy...

I use lines like this:
        gset key title ' {/Symbol b}/'
hoping for the title to include the beta symbol

what I'm *really* hoping for is a way
of creating lovely text like having a beta
followed by, say, subscript 1


I wanted something similar.   I came to the conclusion that you can not
have symbols when in x11 mode.  But, you can do it in postscript
enhanced mode.   In  the gnuplot manual they give an example:


set title '{/Symbol=18 address@hidden/=9.6 0}^{/=12 x}} \
                  {/Helvetica e^{-{/Symbol m}^2/2} d}{/Symbol m}'

The equivalent in Octave is:
gset title '{/Symbol=18 address@hidden/=9.6 0}^{/=12 x}} {/Helvetica
e^{-{/Symbol m}^2/2} d}{/Symbol b}'

The main difference is that every time you would need an escape
character \ to indicate an octal number use a \\ instead.
To do what you wanted beta_1 would look like this:

gset title "{/Symbol=24 b}_{1}"
replot This is not part of your question but may be useful:
I am a bit ingorant of what numbers correspond to what symbols.  I
searched on the web and did not find a table.  So, I ended up making a
script that sort of made a table.  You first need to make some plot,
then run this script.   In the codes.ps file you will find a different
plot for each symbol and octal code.
---------------------------------------------------------------
gset terminal postscript enhanced color
gset output "codes.ps"
for i = 0:7
  for j = 0:7
    for k = 0:7
      cmd = sprintf("gset title \"%d%d%d -> \\\\%d%d%d <-\" font \
      \"Symbol,24\"\n",i,j,k,i,j,k);
      eval(cmd);
      replot;
      pause
    endfor
  endfor
endfor
---------------------------------------------------------------

P.S.  If there is a nice table on the web somwhere will you please point
it out to me. Thanks.


--
David DS Barnes
MED | Imperial College | Exhibition Rd | London sw7 2bx
t/f:0207 594 7181/7127

tap vein, mine deep, share gold





-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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