35 #if defined (HAVE_CONFIG_H)
46 #include "builtin-defun-decls.h"
68 static bool warned =
false;
73 (
"Octave:gnuplot-graphics",
74 "using the gnuplot graphics toolkit is discouraged\n\
76 The gnuplot graphics toolkit is not actively maintained and has a number\n\
77 of limitations that are unlikely to be fixed. Communication with gnuplot\n\
78 uses a one-directional pipe and limited information is passed back to the\n\
79 Octave interpreter so most changes made interactively in the plot window\n\
80 will not be reflected in the graphics properties managed by Octave. For\n\
81 example, if the plot window is closed with a mouse click, Octave will not\n\
82 be notified and will not update its internal list of open figure windows.\n\
83 The qt toolkit is recommended instead.\n");
95 return go.isa (
"figure");
100 if (go.isa (
"figure"))
105 send_quit (props.get___plot_stream__ ());
109 void update (
const graphics_object& go,
int id)
111 if (go.isa (
"figure"))
113 graphics_object obj (go);
120 case base_properties::ID_VISIBLE:
121 if (! props.is_visible ())
123 send_quit (props.get___plot_stream__ ());
124 props.set___plot_stream__ (
Matrix ());
125 props.set_graphicssmoothing (
false);
134 static bool drawnow_executing =
false;
137 if (! drawnow_executing)
139 octave::unwind_protect_var<bool> restore_var (drawnow_executing,
true);
142 args(0) = go.get_handle ().as_octave_value ();
148 const std::string& file,
149 const std::string& debug_file)
const
152 if (! debug_file.empty ())
153 args(3) = debug_file;
156 args(0) = go.get_handle ().as_octave_value ();
170 {
return Matrix (1, 2, 0.0); }
174 if (m_interpreter.mislocked (
"__init_gnuplot__"))
175 m_interpreter.munlock (
"__init_gnuplot__");
192 if (fids.
numel () > 1)
196 if (fids.
numel () > 2)
209 const std::string path = octave::sys::env::getenv (
"PATH");
217 if (tmp(0).is_string () && ! tmp(0).isempty ())
219 std::string gnuplot_binary = tmp(0).string_value ();
224 octave::sys::file_stat fs (gnuplot_path);
226 if (! fs.exists () && ! exeext.empty ())
232 fs = octave::sys::file_stat (gnuplot_path);
235 retval = fs.exists ();
238 catch (
const octave::execution_exception&)
242 interp.recover_from_exception ();
257 error (
"__init_gnuplot__: the gnuplot program is not available, see 'gnuplot_binary'");
258 else if (! interp.mislocked (
"__init_gnuplot__"))
static bool have_gnuplot_binary(void)
OCTINTERP_API const char * EXEEXT
OCTARRAY_OVERRIDABLE_FUNC_API octave_idx_type numel(void) const
Number of elements in the array.
void load_toolkit(const graphics_toolkit &tk)
Matrix matrix_value(bool frc_str_conv=false) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define DEFUN_DLD(name, args_name, nargout_name, doc)
Macro to define an at run time dynamically loadable builtin function.
#define DEFMETHOD_DLD(name, interp_name, args_name, nargout_name, doc)
Macro to define an at run time dynamically loadable builtin method.
void warning_with_id(const char *id, const char *fmt,...)
void error(const char *fmt,...)
OCTAVE_EXPORT octave_value_list Fpclose(octave::interpreter &interp, const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Ffflush(octave::interpreter &interp, const octave_value_list &args, int)
OCTAVE_EXPORT octave_value_list Ffputs(octave::interpreter &interp, const octave_value_list &args, int)
interpreter & __get_interpreter__(void)
T::properties & properties(graphics_object obj)
octave_value_list feval(const char *name, const octave_value_list &args, int nargout)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
OCTAVE_EXPORT octave_value_list Fwaitpid(const octave_value_list &args, int)
std::string search_path_for_file(const std::string &path, const string_vector &names)