~uhh-ssd/+junk/humidity_readout

« back to all changes in this revision

Viewing changes to plplot/plplot-5.9.9/bindings/octave/PLplot/toggle_plplot_use.m

  • Committer: Joachim Erfle
  • Date: 2013-07-24 13:53:41 UTC
  • Revision ID: joachim.erfle@desy.de-20130724135341-1qojpp701zsn009p
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
## usage: toggle_plplot_use
 
2
##
 
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.
 
8
 
 
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
 
14
##
 
15
## Copyright (C) 2003  Rafael Laboissiere
 
16
##
 
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.
 
20
 
 
21
1;
 
22
 
 
23
if ! exist ("use_plplot_state")
 
24
  global use_plplot_state
 
25
  use_plplot_state = "on";
 
26
else
 
27
  if strcmp (use_plplot_state, "on")
 
28
    use_plplot_state = "off";
 
29
  else
 
30
    use_plplot_state = "on";
 
31
  endif
 
32
endif
 
33
 
 
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,:)));
 
39
  endif
 
40
endfor
 
41
 
 
42
if (strcmp (use_plplot_state, "on"))
 
43
  addpath(genpath(use_plplot_path));
 
44
  plplot_stub;
 
45
  if ! exist ("pl_automatic_replot")
 
46
    global pl_automatic_replot
 
47
    pl_automatic_replot = 1;
 
48
  endif
 
49
elseif (strcmp (use_plplot_state, "off"))
 
50
  addpath(genpath(use_plplot_path),"-end");
 
51
endif
 
52
 
 
53
use_plplot_lcd = pwd;
 
54
cd (use_plplot_path);
 
55
for  use_plplot_i = [ char(glob("*.m ")); char(glob("support/*.m ")) ]'
 
56
  clear (strrep (strrep (deblank(use_plplot_i'), ".m", ""), "support/", ""));
 
57
end
 
58
cd (use_plplot_lcd);
 
59
 
 
60
clear use_plplot_path use_plplot_lcd use_plplot_i plplot_path_to_remove
 
61
 
 
62
printf ("Use PLplot: %s\n", use_plplot_state);
 
63