--Alt-Boundary-31770.32524718
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body
Am 8 Jun 2006 um 14:46 hat Mario Rodriguez geschrieben:
>
> > 2. Use Maxima or gnuplot and plot in the default window. Copy the plot to clipboard.
> > (Rightclick on the icon in the upper left corner -> Options -> Copy to Clipboard)
> > Paste the clipboard graphic into IrfanView (nice freeware) or your favourite software for
> > graphics and save the picture to a file. IrfanView for example offers a lot of file formats: jpg
> > in various qualities, png, gif, tif, a lot more.
> >
>
> Hello, Volker, Palmira and Roman:
>
> The following also works, as Roman suggested some days ago:
>
> 1. In Maxima, type:
>
> plot2d(sin(x), [x, 0, 2*%pi],
> [gnuplot_preamble, "set terminal png;set out 'myplot.png'"])$
>
> 2. Now, you can't access myplot.png because wgnuplot is locking it; so
> you can ctrl+alt+del and kill the wgnuplot process.
>
> 3. After that, you can continue working with your Maxima session and
> open myplot.png directly.
>
> But we don't like this horrendous solution, do we?
No, Mario, I really don't want to recommend such a thing. I have never read such an advice
in a serious software documentation.
> The problem here is that in windows, gnuplot is still active after
> making the myplot.png file. I suppose this is an intended behavior,
> since you can move interactively 3d scenes, which is a nice feature.
>
> Plots in the descriptive package don't have this problem, if you write
> (in windows):
> (%i1) load(descriptive)$
> (%i2) histogram(makelist(gauss(0,1),i,1,200),outputdev="png")$
> you'll get the file in png format without any problems.
>
> Maybe, a possible solution is to have a global variable, say
> kill_gnuplot: if true, gnuplot is killed after executing its task, and
> not killed otherwise.
1. If you use the plot window as the output terminal ([gnuplot_term,default]) in Windows the
system call to wgnuplot looks like this:
"wgnuplot.exe gnuplot_command_file.xyz -"
Maxima calls wgnuplot with
"wgnuplot maxout.gnuplot -"
Important is the '-' at the end. Without you will see the plot window just for a millisecond. It
keeps the gnuplot-process alive. The process is finished when you close the plot window.
If you try to plot into a png file by using the 'set terminal png' preamble, in Windows you
have no chance to finish the process, unless you prefer things like Ctrl+Alt+Del.
2. In the case of [gnuplot_term,ps] the call to wgnuplot has no '-' at the end. So the following
works:
plot2d(x,[x,0,1],[gnuplot_term,ps],[gnuplot_preamble,"set term png; set out 'D:/test.png'"]);
test.png is not locked, the gnuplot-process is finished.
So the [gnuplot_term,ps] option can be used, if you wish to plot into a file via a 'set terminal
png' preamble.
Question: Would this be something to recommend? To set [gnuplot_term,ps] if you want a
png output?
Remark: In case of gnuplot_term 'ps' there is a second system call from Maxima:
"ghostview view-file"
This has no meaning in Windows, unless ghostview is installed and registered in the search
path.
In Linux this is different, I suppose. But we are talking about Windows, don't we?
Volker
> I'm not familiar with plot.lisp and a question comes to my mind here:
> would such a thing work in linux?
>
> Best wishes
>
> --
> Mario Rodriguez Riotorto
> www.biomates.net
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
--Alt-Boundary-31770.32524718
Content-type: text/html; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<title></title>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta http-equiv="Content-Style-Type" content="text/css"/>
</head>
<body>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">Am 8 Jun 2006 um 14:46 hat Mario Rodriguez geschrieben:</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt"><br />
</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> > 2. Use Maxima or gnuplot and plot in the default window. Copy the plot to clipboard. </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> > (Rightclick on the icon in the upper left corner -> Options -> Copy to Clipboard)</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> > Paste the clipboard graphic into IrfanView (nice freeware) or your favourite software for </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> > graphics and save the picture to a file. IrfanView for example offers a lot of file formats: jpg </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> > in various qualities, png, gif, tif, a lot more.</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> > </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> Hello, Volker, Palmira and Roman:</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> The following also works, as Roman suggested some days ago:</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> 1. In Maxima, type:</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">>  </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> plot2d(sin(x), [x, 0, 2*%pi], </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">>   [gnuplot_preamble, "set terminal png;set out 'myplot.png'"])$</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> 2. Now, you can't access myplot.png because wgnuplot is locking it; so</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> you can ctrl+alt+del and kill the wgnuplot process.</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> 3. After that, you can continue working with your Maxima session and</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> open myplot.png directly.</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> But we don't like this horrendous solution, do we?</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt"><br />
</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">No, Mario, I really don't want to recommend such a thing. I have never read such an advice
in a serious software documentation. </span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt"><br />
</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt"><br />
</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> The problem here is that in windows, gnuplot is still active after</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> making the myplot.png file. I suppose this is an intended behavior,</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> since you can move interactively 3d scenes, which is a nice feature.</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> Plots in the descriptive package don't have this problem, if you write</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> (in windows):</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> (%i1) load(descriptive)$</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> (%i2) histogram(makelist(gauss(0,1),i,1,200),outputdev="png")$</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> you'll get the file in png format without any problems.</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> Maybe, a possible solution is to have a global variable, say</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> kill_gnuplot: if true, gnuplot is killed after executing its task, and</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> not killed otherwise.</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt"><br />
</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">1. If you use the plot window as the output terminal ([gnuplot_term,default]) in Windows the
system call to wgnuplot looks like this:</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">"wgnuplot.exe gnuplot_command_file.xyz -"</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt"><br />
</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">Maxima calls wgnuplot with </span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">"wgnuplot maxout.gnuplot -"</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt"><br />
</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">Important is the '-' at the end. Without you will see the plot window just for a millisecond. It
keeps the gnuplot-process alive. The process is finished when you close the plot window.</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt"><br />
</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">If you try to plot into a png file by using the 'set terminal png' preamble, in Windows you
have no chance to finish the process, unless you prefer things like Ctrl+Alt+Del. </span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt"><br />
</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">2. In the case of [gnuplot_term,ps] the call to wgnuplot has no '-' at the end. So the following
works:</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt"><br />
</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">plot2d(x,[x,0,1],[gnuplot_term,ps],[gnuplot_preamble,"set term png; set out 'D:/test.png'"]);</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt"><br />
</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">test.png is not locked, the gnuplot-process is finished. </span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">So the [gnuplot_term,ps] option can be used, if you wish to plot into a file via a 'set terminal
png' preamble.</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt"><br />
</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">Question: Would this be something to recommend? To set [gnuplot_term,ps] if you want a
png output?</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt"><br />
</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">Remark: In case of gnuplot_term 'ps' there is a second system call from Maxima:</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">"ghostview view-file"</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">This has no meaning in Windows, unless ghostview is installed and registered in the search
path.</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">In Linux this is different, I suppose. But we are talking about Windows, don't we?</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt"><br />
</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt">Volker</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt"><br />
</span></font></div>
<div align="left"><font face="Arial" size="2"><span style="font-size:10pt"><br />
</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> I'm not familiar with plot.lisp and a question comes to my mind here:</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> would such a thing work in linux?</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> Best wishes</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> -- </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> Mario Rodriguez Riotorto</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> www.biomates.net</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> </span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> _______________________________________________</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> Maxima mailing list</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> Maxima at math.utexas.edu</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt">> http://www.math.utexas.edu/mailman/listinfo/maxima</span></font></div>
<div align="left"><font face="Arial" color="#7f0000" size="2"><span style="font-size:10pt"><br />
</span></font></div>
<div align="left"></div>
</body>
</html>
--Alt-Boundary-31770.32524718--