help-octave
[Top][All Lists]
Advanced

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

Print to png errors with ghostscript.


From: Rowan Diskin
Subject: Print to png errors with ghostscript.
Date: Sun, 14 Apr 2019 12:08:55 +0100

Firstly, my apologies, I'm not massively familiar with octave (or even matlab), I'm trying to transition a simple plotting and saving function from MATLAB that I wrote last year and use very regularly to speed up my workflow. I'm also not very familiar with terminal and UNIX-y things on the mac but I'm doing my best to get my head round it!

Version details:
Mac OS X 10.14.3 Mojave.
Octave 5.1.0 from homebrew
XQuartz 2.7.11 (I don't know if octave uses this??)
gnuplot (Version 5.2.6.1)
ghostscript (version 9.26_1)
fltk (version 1.3.5)

(I followed this tutorial https://www.ritchieng.com/octave-mac-setup/#4b-create-and-edit-octaverc-fileI wasn't able to get the  gnuplot --with-x11 to work so I've just installed gnuplot with brew install gnuplot. XQuartz is already on my system as above.)

I'm using the GUI with an .app as described in https://wiki.octave.org/Octave_for_macOS

My issue is that I'm getting an error message when I try to run saveas or print to create a PNG. Using for eg:

saveas(fig, ' Name.png');

or 

print -deps foo.eps


The error message on 5.1.0 reads:
"warning: print.m: Ghostscript binary is not available.  Only eps output is possible
warning: called from
    __print_parse_opts__ at line 487 column 7
    print at line 416 column 8
    saveas at line 110 column 3
    soakprocess2 at line 52 column 1"

My .octaverc currently reads:

## Begin save-path auto-created section, do not edit
  addpath ('/Users/Rowan/AW Google Drive/Repair Data/SoakTests/MATLAB', '-begin');

## End savepath auto-created section

setenv ("GNUTERM", "X11")

setenv('GNUTERM','qt')
graphics_toolkit("gnuplot")

cmd_path = getenv ("path"); 
gs_path = "/usr/local/opt/ghostscript";
if (isempty (strfind (cmd_path, gs_path))) 
setenv("path", strcat (cmd_path, pathsep(), gs_path));
endi 

But I'm getting a startup error so I've clearly done something wrong there too. I suspect it's because all the examples of setting gs_path online seem to be for windows.

parse error near line 16 of file /Users/Rowan/.octaverc

That's also confusing because there are only 15 lines!

I've tried with and without changing to the gnuplot toolkit.

I've spent about 6 hours on this googling and trying various bits so I'm just about ready to plot my graphs with a pencil now! 

Kind Regards,

Rowan


reply via email to

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