plot directly to postscript with Octave2.9 on low end server

View: New views
2 Messages — Rating Filter:   Alert me  

plot directly to postscript with Octave2.9 on low end server

by jacco77 () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi (sorry if this is the wrong fora, but I have *really* searched on the web/dokumentation without any luck)

I am trying to produce a postscript plot using octave on my Ubuntu 7.10 server. Note the server has no X server running. I have tried several ways, the one that felt the most promising was to try

__gnuplot_set__ terminal postscript
__gnuplot_set__ output "test.ps"
x = -1:0.1:1;
plot (x, x.^2)

This is because the two upper commands (set terminal, set output) works well in gnuplot on the very same computer (ie I can produce postscript plot on the same coputer with gnuplot). Hower the code above gives an error message on the first line

"Expected X11 driver: /usr/lib/gnuplot/gnuplot_x11"

The package gnuplot-x11 is not installed on the machine. Howeve this package is not in the gnuplot dependecy as stated here

http://packages.debian.org/etch/gnuplot-x11


Any suggestions would greatly appreciated!

David

Re: plot directly to postscript with Octave2.9 on low end server

by Dr. Ing. Dieter Jurzitza :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear Jacco,
there is only one way IMHO:

write the data you want to plot into a file (for example) "dummy.dat"
containing (for example) x - y values, e.g.

0 0
1 1
2 4
3 9

for y=x**2. The file can be handled very much like in "C", fopen will open it,
fprintf can write to it etc ....
Then write a plt-file dummy.plt with the following contents (or similar):

#!/usr/bin/gnuplot
set terminal postscript enhanced color solid linewidth 2 "Arial, 12"
set output "dummy.ps"
plot "dummy.dat" using 1:2 w l
set output
set terminal

make it executable system("chmod 0755 dummy.plt") and execute "dummy.plt" with
a system command from within octave (system(dummy.plt)). This should result
in a postscript file "dummy.ps" in your working directory.
Hope this helps,
take care



Dieter

--
-----------------------------------------------------------

                               |
                                \
                 /\_/\           |
                | ~x~ |/-----\   /
                 \   /-       \_/
  ^^__   _        /  _  ____   /
 <°°__ \- \_/     |  |/    |  |
  ||  ||         _| _|    _| _|

if you really want to see the pictures above - use some font
with constant spacing like courier! :-)
-----------------------------------------------------------Am Dienstag, 3.
Juni 2008 16:32:47 schrieb jacco77:
> Hi,
>
> I am trying to produce a postscript plot using octave on my Ubuntu 7.10
******

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave