File: toggle_plplot_use.m

package info (click to toggle)
plplot 5.15.0%2Bdfsg2-15
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 31,396 kB
  • sloc: ansic: 79,703; xml: 28,583; cpp: 20,033; ada: 19,456; tcl: 12,081; f90: 11,431; ml: 7,276; java: 6,863; python: 6,792; sh: 3,274; perl: 828; lisp: 75; makefile: 74; sed: 34; fortran: 6
file content (68 lines) | stat: -rw-r--r-- 2,197 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
## usage: toggle_plplot_use
##
## Use this script to activate/deactivate the default library for the
## PLplot plotting function (plot, mesh, etc.), as both the native
## gnuplot and the new octave-plplot libraries use similar names to the
## functions. toggle_plplot_use post-/pre-pends to the path for
## the PLplot functions in successive calls.

## File: toggle_plplot_use.m
## Author: Rafael Laboissiere <rafael@debian.org>
## Modified: Joao Cardoso
## Created on: Sun Oct 18 22:03:10 CEST 1998
## Last modified on: Fri Mar  7 09:38:38 CET 2003
##
## Copyright (C) 2003  Rafael Laboissiere
##
## PLplot is free software, distributable under the GPL. No
## warranties, use it at your own risk.  It  was originally written for
## inclusion in the Debian octave-plplot package.

1;

if ! exist ("use_plplot_state")
  global use_plplot_state
  use_plplot_state = "on";
  global default_shadow_warning
  default_shadow_warning = warning("query","Octave:shadowed-function");
  warning("off","Octave:shadowed-function");
else
  if strcmp (use_plplot_state, "on")
    use_plplot_state = "off";
    warning(default_shadow_warning.state,"Octave:shadowed-function");
  else
    use_plplot_state = "on";
    warning("off","Octave:shadowed-function");
  endif
endif

use_plplot_path = plplot_octave_path;
plplot_path_to_remove = char(strsplit(genpath(use_plplot_path),pathsep));
for use_plplot_i=1:size(plplot_path_to_remove)(1)
  if (findstr(path,deblank(plplot_path_to_remove(use_plplot_i,:))) > 0)
    rmpath(deblank(plplot_path_to_remove(use_plplot_i,:)));
  endif
endfor

if (strcmp (use_plplot_state, "on"))
  addpath(genpath(use_plplot_path));
  plplot_stub;
  if ! exist ("pl_automatic_replot")
    global pl_automatic_replot
    pl_automatic_replot = 1;
  endif
elseif (strcmp (use_plplot_state, "off"))
  addpath(genpath(use_plplot_path),"-end");
endif

use_plplot_lcd = pwd;
cd (use_plplot_path);
for  use_plplot_i = [ char(glob("*.m ")); char(glob("support/*.m ")) ]'
  clear (strrep (strrep (deblank(use_plplot_i'), ".m", ""), "support/", ""));
end
cd (use_plplot_lcd);

clear use_plplot_path use_plplot_lcd use_plplot_i plplot_path_to_remove

printf ("Use PLplot: %s\n", use_plplot_state);