4

I am using win7 and octave 3.6.4, when i generate a plot with octave and save as .eps its colors go away. For example :

clf();
surf(peaks);

generates following graphic enter image description here

But when i run the following codes seperately

saveas (1,"test.eps")  or print (1,"test.eps") or print -deps test.eps

to save the graphic as .eps and import it into latex it becomes grayscale. enter image description here

user1772257
  • 323
  • 2
  • 4
  • 14
  • that's a weird problem. Did you try to open the eps file in another program to check if it has colour? Are you sure the problem is not in the LaTeX side? – carandraug Dec 16 '13 at 14:52

2 Answers2

9

Try

print -depsc test.eps

or

print -color -depsc test.eps

if the first one doesn't work.

EDIT:

Which graphics toolkit are you using? with gnuplot, it works just fine for me (Octave 3.6.2, Win XP) using the -eps flag.

am304
  • 13,758
  • 2
  • 22
  • 40
  • 1
    `pkg load gnuplot`? Don't you mean `graphics_toolkit gnuplot`? – carandraug Dec 16 '13 at 14:51
  • No, I did mean `pkg load gnuplot`, but actually it was when using the `qt` graphics toolkit which gave me errors when trying to print to eps. Loading the `gnuplot` package got rid of the errors, but I was still unable to print. I then switched to the `gnuplot` graphics toolkit and I was able to print successfully. I will remove this from my answer as it's irrelevant. Thanks for pointing it out. – am304 Dec 16 '13 at 15:03
  • It worked for me, thanks. – Yilmazerhakan Dec 08 '21 at 22:03
1

you can use

print -dtex test.tex

Octave automatically exports your figure into LaTeX/Color EPS figure, with LaTeX fonts.

David
  • 11
  • 1