[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: Plots and Latex

**From**: |
Steve C. Thompson |

**Subject**: |
Re: Plots and Latex |

**Date**: |
Thu, 15 Mar 2007 14:55:35 -0700 |

On Fri, 2007-03-16 at 10:39 +1300, Ana Rakonjac wrote:
>* When generating plots in Matlab, there is a nice m-file called*
>* laprint.m that makes the graph nice for Latex, eg. changing the*
>* fonts to match the default Latex fonts. When I try using it in*
>* Octave, I get an error.*
>
>* I know the way Matlab does plots and the way Octave does plots*
>* are different, so I wouldn't really expect laprint.m to work.*
>* Is there a similar way to make plots nice for Latex in Octave?*
I'm happy with a two-step method:
Step 1: Save data to text file.
tmp = [x', y'];
save -text 'main.dat' tmp
Step 2: Use Gnuplot to plot `main.dat'
set term pslatex color solid rotate 8
set ylabel 'Bit error rate'
set xlabel '[t] {Average bit energy-to-noise density ratio, \
$\gamma$ (dB)}'
set output "plot.tex"
plot [ : ] [ : ] "main.dat" not w l lt 1 lw 1
In the LaTeX source, do a `\input {plot}'.
>* Also, is there a way to get rid of the "Line 1" legend that is*
>* on plots by default?*
plot (x, y, ';;')
Steve