help-octave
[Top][All Lists]
Advanced

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

Re: Plots and Latex


From: A. Scottedward Hodel
Subject: Re: Plots and Latex
Date: Tue, 20 Mar 2007 09:43:17 -0500

I have had very good experience with printing to xfig and then running fig2ps (available at sourceforge.net) to convert an xfig file with embedded LaTeX commands into .eps. I've used this with both LaTeX and with LyX. With fig2ps I use a line like this in my Makefile so that conversion is automated:
        fig2ps --forcespecial --add=epsfig --eps --bbox=dvips $<

In Octave, I use
        print -dfig myfile.fig

and the rest is fairly straightforward.


A. Scottedward Hodel, 334 844-1854, fax 334 844-1809
address@hidden http://www.eng.auburn.edu/~hodelas



On Mar 18, 2007, at 4:25 PM, juanjo wrote:


`gnuplot' has several terminals to print the plot. One of them is `gpic'. `gpic' was developed to work with troff but you can use it to get latex pictures. Although `gpic' has a latex output, I recommend you using `dpic' a
pic processor written by Dwight Aplevich
(http://www.ece.uwaterloo.ca/~aplevich/Circuit_macros/). After you have plotted your figure with octave and gnuplot follow the next steps (write
these commands):
1. octave:>__gnuplot_set__('terminal gpic')
2. octave:>__gnuplot_set__ output "filename.pic"
3. octave:>replot
4. octave:>__gnuplot_set__('terminal x11')

The first command activates the gpic terminal. The second command indicates
the name of the file where the figure will be saved. The third command
redraws the plot, but is done as a file. The last command reactivates the
x11 terminal.
The next step is open the file `filename.pic' . Then, the lines that are out
of the macros .PS and .PE must be delete.
The last step is write:
[prompt]$ dpic -p filename.pic > filename.tex

And you get a pstricks file to be used with latex. You can read the
Aplevich's documentation about dpic to get other outputs: TikZ, metapost
format, ...


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?

Also, is there a way to get rid of the "Line 1" legend that is on
plots by default?

Thanks,
Ana


--
"Come now, do you really expect me to do coordinate substitution in my
head while strapped to a centrifuge?"
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave



--
View this message in context: http://www.nabble.com/Plots-and-Latex- tf3411180.html#a9543117
Sent from the Octave - General mailing list archive at Nabble.com.

_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave



reply via email to

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