|
From: | Rowan Diskin |
Subject: | Re: Print to png errors with ghostscript. |
Date: | Sun, 14 Apr 2019 19:34:50 +0100 |
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 homebrewXQuartz 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-file. I 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_macOSMy 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??orprint -deps foo.epsThe error message on 5.1.0 reads:"warning: print.m: Ghostscript binary is not available. Only eps output is possiblewarning: called from__print_parse_opts__ at line 487 column 7print at line 416 column 8saveas at line 110 column 3soakprocess2 at line 52 column 1"My .octaverc currently reads:## Begin save-path auto-created section, do not editaddpath ('/Users/Rowan/AW Google Drive/Repair Data/SoakTests/MATLAB', '-begin');## End savepath auto-created sectionsetenv ("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));endiBut 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/.octavercThat'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 readendifNotendiCheers... Ian
[Prev in Thread] | Current Thread | [Next in Thread] |