-dpng gives "invalid command"
John B. Thoo
jthoo at yccd.edu
Tue Jul 14 14:11:05 CDT 2009
On Jul 10, 2009, at 11:55 AM, Thomas Treichl wrote:
> John B. Thoo schrieb:
>> On Jul 10, 2009, at 11:29 AM, Thomas Treichl wrote:
>>> John B. Thoo schrieb:
>>>> Hi, Thomas.
>>>> gnuplot> show version long
>>>> G N U P L O T
>>>> Version 4.2 patchlevel 5
>>>> last modified Mar 2009
>>>> System: Darwin 8.11.0
>>>> Copyright (C) 1986 - 1993, 1998, 2004, 2007 - 2009
>>>> Thomas Williams, Colin Kelley and many others
>>>> Type `help` to access the on-line reference manual.
>>>> The gnuplot FAQ is available from http://
>>>> www.gnuplot.info/faq/
>>>> Send bug reports and suggestions to <http://
>>>> sourceforge.net/projects/gnuplot>
>>>> Compile options:
>>>> +READLINE -LIBREADLINE +HISTORY +BACKWARDS_COMPATIBILITY
>>>> +BINARY_DATA
>>>> -LIBGD
>>>> -NOCWDRC +X11 +X11_POLYGON +MULTIBYTE +USE_MOUSE
>>>> +HIDDEN3D_QUADTREE
>>>> +DATASTRINGS +HISTOGRAMS +OBJECTS +STRINGVARS +MACROS +IMAGE
>>>> DRIVER_DIR = "/usr/local/libexec/gnuplot/4.2"
>>>> GNUPLOT_PS_DIR = "/usr/local/share/gnuplot/4.2/PostScript"
>>>> HELPFILE = "/usr/local/share/gnuplot/4.2/gnuplot.gih"
>>>> gnuplot>
>>>> Thanks.
>>>> ---John.
>>>
>>> Then yes, you're right - you're missing support for *png. Your
>>> version of Gnuplot has not been compiled against libgd. libgd
>>> (and libpng and libjpg...) is the library that you need to create
>>> graphics in *png, *jpg and *gif.
>>>
>>> As your binary is in /usr/local I would expect you either compile
>>> and install Gnuplot for yourself or you use MacPorts? Either or,
>>> you need a binary that should give you something like this to
>>> save in *png on your Mac (compare compile options GD_* from my
>>> machine with yours):
>>>
>>> gnuplot> show version long
>>>
>>> G N U P L O T
>>> Version 4.2 patchlevel 5
>>> last modified Mar 2009
>>> System: Darwin 8.11.1
>>>
>>> Copyright (C) 1986 - 1993, 1998, 2004, 2007 - 2009
>>> Thomas Williams, Colin Kelley and many others
>>>
>>> Type `help` to access the on-line reference manual.
>>> The gnuplot FAQ is available from http://www.gnuplot.info/
>>> faq/
>>>
>>> Send bug reports and suggestions to
>>> <http://sourceforge.net/projects/gnuplot>
>>>
>>> Compile options:
>>> -READLINE +LIBREADLINE +HISTORY +BACKWARDS_COMPATIBILITY
>>> +BINARY_DATA
>>> +GD_PNG +GD_JPEG +GD_GIF +ANIMATION
>>> -NOCWDRC +X11 +X11_POLYGON +MULTIBYTE +USE_MOUSE
>>> +HIDDEN3D_QUADTREE
>>> +DATASTRINGS +HISTOGRAMS +OBJECTS +STRINGVARS +MACROS +IMAGE
>>>
>>> DRIVER_DIR =
>>> "/Users/Thomas/bin/Octave.app.3.2.0/Gnuplot.app/Contents/
>>> Resources/libexec/gnuplot/4.2"
>>> GNUPLOT_PS_DIR = "/tmp/gnuplot-i386/share/gnuplot/4.2/PostScript"
>>> HELPFILE = "/Users/Thomas/bin/Octave.app.3.2.0/
>>> Gnuplot.app/Contents/Resources/share/gnuplot/4.2/gnuplot.gih"
>>>
>>> Hope this helps somehow,
>>>
>>> Thomas
>> Hi, Thomas.
>> Yes, I compiled gnuplot myself. (I guess that was a mistake.)
>> Would the easiest thing for me to do now be to install gnuplot
>> from your octave-3.2.0-ppc.dmg?
>> If I drag-and-drop gnuplot from the .dmg into my Applications
>> folder, would I then have to do anything in particular to use it
>> instead of my previous installation?
>> Thanks again.
>> ---John.
>
> Hi John,
>
> why a mistake? From my point of view it is good if you try to
> compile things for yourself. You just need to set up some more
> libraries before compiling Gnuplot.
>
> Suggestion: If you already use Fink or MacPorts then this might be
> a better solution to install Gnuplot that way. If you have none of
> those or prefer Gnuplot.app beside others you can also use
> Gnuplot.app, yes. There nearly is nothing more to do: Drag'n'Drop
> Gnuplot.app from the *dmg to your Applications folder and then set
> another link to use Gnuplot.app from command line, too (maybe you
> should remove or rename or uninstall /usr/local/bin/gnuplot* before):
>
> sudo ln -s /Applications/Gnuplot.app/Contents/Resources/bin/
> gnuplot /usr/local/bin/gnuplot
>
> Finally just type 'gnuplot' in Terminal.app and check once again
> 'show version long'. Start your Octave and check
>
> octave-3.2.0:1> system ('which gnuplot')
>
> Best regards,
>
> Thomas
Hi, Thomas.
I installed your Gnuplot.app in my Applications folder and set the
following symlink:
sudo ln -sfv /Applications/Gnuplot.app/Contents/Resources/bin/
gnuplot /usr/bin/gnuplot
In gnuplot, I find that
gnuplot> system ('which gnuplot')
/Applications/Gnuplot.app/Contents/Resources/bin/gnuplot
gnuplot>
so I think it all looks OK. I also tried to print a PNG and that
worked: yea! :-)
The only difference I see immediately between using Gnuplot.app and
the gnuplot I had complied from source (besides now being able to
print a PNG) is that the redrawing in Gnuplot.app seems to be slower,
so that the following, which produced a pretty smooth animation in
gnuplot, produces a somewhat jerky animation in Gnuplot.app:
lT = length (T) - 1;
N = 10; % number of time intervals (frames) to plot (must have
N <= lT)
if (N > lT)
error ('N > lT; need N <= lT');
end
time = ones (1, N);
time(2:N+1) = floor ((lT/N)*(1:N)) + 1;
for j = 1:N+1 % for "ode45"
plot (x, u(:,time(j)));
title (strcat ('time =', num2str ((tf-t0)*(time(j) - 1)/lT)));
% axis ([0 2*pi -1.5 1.5]);
axis([0 2*pi 2*min(real(u0)) 2*max(real(u0))]);
pause(wait);
end
I'm not sure why.
Btw, while I was at it, I also upgraded Octave to 3.2.0.
Thanks for making this all very simple.
---John.
More information about the Help-octave
mailing list