Editing FAQ
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
=General= | =General= | ||
==Who uses Octave?== | ==Who uses Octave?== | ||
Lots of people. It seems that universities use it for research and teaching, companies of all sizes, for development, individuals. This question comes often on Octave mailing lists, see [[WhoUsesOctave]] for a few answers | |||
=Coding= | |||
==How do we erase a figure?== | |||
closeplot(); | |||
closefig(number) | |||
==How do we vary the line thickness?== | |||
* There's plpot_octave, but the one in debian doesn't work for me. | |||
* Here's my octave hack for it--- http://gnufans.net/~deego/pub/octave/plot_width.m This one simply draws the line multiple times. | |||
* You can edit the .eps file manually or using sed and awk. | |||
* Export the graph as fig file (gset term fig thickness 2). This also allows for easy postediting with xfig and export to formats not supported by gnuplot. | |||
* The gplot command of octave does not support gnuplot's linewidth parameter Thus you must use the graw() function for sending this option directly to gnuplot, eg. | |||
graw('replot "" notitle with lines lw 4\n'); | |||
*Search the [http://octave.1599824.n4.nabble.com/ octave archives] for more. | |||
==How do I call an octave function from C++?== | |||
*Here is an untested code snippet for calling rand([9000,1]), modified from a post by HerberFarnsworth? to help-octave on 2003-05-01: | |||
#include <octave/oct.h> | |||
... | |||
ColumnVector NumRands(2); | |||
NumRands(0) = 9000; | |||
NumRands(1) = 1; | |||
octave_value_list f_arg, f_ret; | |||
f_arg(0) = octave_value(NumRands); | |||
f_ret = feval("rand",f_arg,1); | |||
Matrix unis(f_ret(0).matrix_value()); | |||
==How do I create a full semilog/log grid== | |||
gset grid mxtics mytics | |||
gset grid lw 2, lw 0.1 | |||
grid("on"); | |||
One can use postscript enhancement for proper axis | |||
gset format x "10^{%%L}" | |||
or | |||
gset format y "10^{%%L}" | |||
==How do I change | ==How do I change colour/line definition in gnuplot postscript?== | ||
Here is a awk script to get a rainbow colour map | |||
Here is a awk script to get a rainbow | |||
#!/bin/awk -f | #!/bin/awk -f | ||
Line 404: | Line 84: | ||
==How do I tell if a file exists?== | ==How do I tell if a file exists?== | ||
Look at functions like exist, file_in_path.. and the other functions that their descriptions point to. | |||
==How do I get sound output in Windows?== | |||
See http://www.octave.org/octave-lists/archive/help-octave.2003/msg01567.html for a start. | |||
= | ==How do I create a plot without a window popping up (ie, a plot to a file)?== | ||
figure(1, "visible", "off"); | |||
plot(sin(1:100)); | |||
print -deps "/tmp/sin.eps" | |||
One can set that behaviour as default: | |||
set(0, 'defaultfigurevisible', 'off'); | |||
== Why does Octave segfault when using "clear all;"?== | |||
This is a known problem if you have one of the following packages loaded: | |||
ann | |||
database | |||
ftp | |||
See http://www.nabble.com/Segmentation-Fault---Clear-all-td21998563.html for a discussion |