1
## usage: toggle_plplot_use
3
## Use this script to activate/deactivate the default library for the
4
## PLplot plotting function (plot, mesh, etc.), as both the native
5
## gnuplot and the new octave-plplot libraries use similar names to the
6
## functions. toggle_plplot_use post-/pre-pends to the path for
7
## the PLplot functions in successive calls.
9
## File: toggle_plplot_use.m
10
## Author: Rafael Laboissiere <rafael@debian.org>
11
## Modified: Joao Cardoso
12
## Created on: Sun Oct 18 22:03:10 CEST 1998
13
## Last modified on: Fri Mar 7 09:38:38 CET 2003
15
## Copyright (C) 2003 Rafael Laboissiere
17
## PLplot is free software, distributable under the GPL. No
18
## warranties, use it at your own risk. It was originally written for
19
## inclusion in the Debian octave-plplot package.
23
if ! exist ("use_plplot_state")
24
global use_plplot_state
25
use_plplot_state = "on";
27
if strcmp (use_plplot_state, "on")
28
use_plplot_state = "off";
30
use_plplot_state = "on";
34
use_plplot_path = plplot_octave_path;
35
plplot_path_to_remove = split(genpath(use_plplot_path),pathsep);
36
for use_plplot_i=1:size(plplot_path_to_remove)(1)
37
if (findstr(path,deblank(plplot_path_to_remove(use_plplot_i,:))) > 0)
38
rmpath(deblank(plplot_path_to_remove(use_plplot_i,:)));
42
if (strcmp (use_plplot_state, "on"))
43
addpath(genpath(use_plplot_path));
45
if ! exist ("pl_automatic_replot")
46
global pl_automatic_replot
47
pl_automatic_replot = 1;
49
elseif (strcmp (use_plplot_state, "off"))
50
addpath(genpath(use_plplot_path),"-end");
55
for use_plplot_i = [ char(glob("*.m ")); char(glob("support/*.m ")) ]'
56
clear (strrep (strrep (deblank(use_plplot_i'), ".m", ""), "support/", ""));
60
clear use_plplot_path use_plplot_lcd use_plplot_i plplot_path_to_remove
62
printf ("Use PLplot: %s\n", use_plplot_state);