help-octave
[Top][All Lists]
Advanced

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

Re: Print to png errors with ghostscript.


From: Rowan Diskin
Subject: Re: Print to png errors with ghostscript.
Date: Sun, 14 Apr 2019 19:34:50 +0100

Thanks for your help Ian,

I have fixed this. 

The error now reads 

error: graphics_toolkit: gnuplot toolkit is not available
error: called from
    graphics_toolkit at line 81 column 5
    /Users/Rowan/.octaverc at line 9 column 1


(the space in name.png was unintentional, but not in my code)

Kind Regards,

Rowan
Ampworks, Newark

Mob: 07999 575676
Web: www.ampworks.co.uk
_____________________________________________________________________

Happy with your Ampworks repair? If you have time, please post a review on one of these sites, your feedback is valued:
Google Maps     Facebook    Freeindex      Qype


On Sun, 14 Apr 2019 at 15:28, Ian McCallion <address@hidden> wrote:

On Sunday, 14 April 2019, Rowan Diskin <address@hidden> wrote:
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');

Did you mean to have a blank in the name??

 
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!

When octave says "parse error" the script is not even started, so it is essential to fix that problem first. It says line 16 because it is expecting more lines, and that is because line 15 should read
   endif
Not
   endi

Cheers... Ian

reply via email to

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