From: Mario R. R. <rio...@us...> - 2014-07-28 09:19:38
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Maxima CAS". The branch, master has been updated via a11f1a4829c8794bdf9898e51dc23cc68107aa84 (commit) from e057f0c7197d75475e4d6ed534ad78e3116f849c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a11f1a4829c8794bdf9898e51dc23cc68107aa84 Author: Mario Rodriguez <rio...@us...> Date: Mon Jul 28 11:19:07 2014 +0200 Rotate z label when it is too long. Return error messages when variables are not defined in graphic objects. diff --git a/share/draw/gnuplot.lisp b/share/draw/gnuplot.lisp index 1e8305e..67c0ca6 100644 --- a/share/draw/gnuplot.lisp +++ b/share/draw/gnuplot.lisp @@ -1197,9 +1197,11 @@ (ymax most-negative-double-float) (*plot-realpart* *plot-realpart*) x-samples y-samples yy result pltcmd result-array) - (setq *plot-realpart* (get-option '$draw_realpart)) - (if (< xmax xmin) + (when (< xmax xmin) (merror "draw2d (explicit): illegal range")) + (when (not (subsetp (rest ($listofvars fcn)) (list var))) + (merror "draw2d (explicit): non defined variable")) + (setq *plot-realpart* (get-option '$draw_realpart)) (setf fcn ($float fcn)) (cond ((floatp fcn) ; if function is a constant, we only need the end points @@ -1352,6 +1354,9 @@ (pts '()) pltcmd grouping x y) + (when (not (subsetp (rest ($listofvars ineq)) (list x-var y-var))) + (merror "draw2d (region): non defined variable")) + ; build 2d arrays: x, y and boolean (labels ((fun (xx yy) ; evaluates boolean expression (is-boole-check @@ -1580,12 +1585,13 @@ ,(1+ ($second ip-grid))))) (ssample (make-array `(,(1+ ($first ip-grid-in)) ,(1+ ($second ip-grid-in))))) ) - + + (when (not (subsetp (rest ($listofvars expr)) (list x y))) + (merror "draw2d (implicit): non defined variable")) (setq e (coerce-float-fun (imp-pl-prepare-expr expr) `((mlist simp) ,x ,y))) (update-ranges-2d xmin xmax ymin ymax) - (sample-data e xmin xmax ymin ymax sample ip-grid) (do ((i 0 (1+ i))) ((= i ($first ip-grid))) @@ -1642,6 +1648,8 @@ (pts '()) (grouping '()) pltcmd ncols vertices) + (when (not (subsetp (rest ($listofvars expr)) (list par1 par2 par3))) + (merror "draw3d (implicit): non defined variable")) (check-enhanced3d-model "implicit" '(0 3 99)) (when (= *draw-enhanced3d-type* 99) (update-enhanced3d-expression (list '(mlist) par1 par2 par3))) @@ -1733,6 +1741,8 @@ ($numer t) (count -1) ncols result) + (when (not (subsetp (rest ($listofvars fcn)) (list par1 par2))) + (merror "draw2d (explicit): non defined variable")) (setq *plot-realpart* (get-option '$draw_realpart)) (check-enhanced3d-model "explicit" '(0 2 3 99)) (when (= *draw-enhanced3d-type* 99) @@ -2065,9 +2075,11 @@ (tt ($float parmin)) (eps (/ (- tmax tmin) (- nticks 1))) result f1 f2 xx yy) - (setq *plot-realpart* (get-option '$draw_realpart)) - (if (< tmax tmin) + (when (< tmax tmin) (merror "draw2d (parametric): illegal range")) + (when (not (subsetp (append (rest ($listofvars xfun)) (rest ($listofvars yfun))) (list par))) + (merror "draw2d (parametric): non defined variable")) + (setq *plot-realpart* (get-option '$draw_realpart)) (setq f1 (coerce-float-fun xfun `((mlist), par))) (setq f2 (coerce-float-fun yfun `((mlist), par))) (setf result @@ -2216,6 +2228,8 @@ (eps (/ (- tmax tmin) (- nticks 1))) (count -1) ncols result f1 f2 f3 xx yy zz) + (when (not (subsetp (rest ($append ($listofvars xfun) ($listofvars yfun) ($listofvars zfun))) (list par1))) + (merror "draw3d (parametric): non defined variable")) (setq *plot-realpart* (get-option '$draw_realpart)) (check-enhanced3d-model "parametric" '(0 1 3 99)) (when (= *draw-enhanced3d-type* 99) @@ -2299,6 +2313,8 @@ (nv (+ vgrid 1)) (count -1) ncols result f1 f2 f3 xx yy zz uu vv) + (when (not (subsetp (rest ($append ($listofvars xfun) ($listofvars yfun) ($listofvars zfun))) (list par1 par2))) + (merror "draw3d (parametric_surface): non defined variable")) (setq *plot-realpart* (get-option '$draw_realpart)) (check-enhanced3d-model "parametric_surface" '(0 2 3 99)) (when (= *draw-enhanced3d-type* 99) @@ -2408,6 +2424,10 @@ uxold uyold uzold ttnext) (when (< tmax tmin) (merror "draw3d (tube): illegal range")) + (when (not (subsetp (rest ($append ($listofvars xfun) ($listofvars yfun) + ($listofvars zfun) ($listofvars rad))) + (list par1))) + (merror "draw3d (tube): non defined variable")) (check-enhanced3d-model "tube" '(0 1 3 99)) (when (= *draw-enhanced3d-type* 99) (update-enhanced3d-expression (list '(mlist) par1))) @@ -2919,7 +2939,9 @@ (format nil "set title '~a'~%" (get-option '$title)) (format nil "set xlabel '~a'~%" (get-option '$xlabel)) (format nil "set ylabel '~a'~%" (get-option '$ylabel)) - (format nil "set zlabel '~a'~%" (get-option '$zlabel)) + (if (< (length (get-option '$zlabel)) 5) + (format nil "set zlabel '~a'~%" (get-option '$zlabel)) + (format nil "set zlabel '~a' rotate~%" (get-option '$zlabel)) ) (format nil "set datafile missing 'NIL'~%") (if (get-option '$logx) (format nil "set logscale x~%") ----------------------------------------------------------------------- Summary of changes: share/draw/gnuplot.lisp | 36 +++++++++++++++++++++++++++++------- 1 files changed, 29 insertions(+), 7 deletions(-) hooks/post-receive -- Maxima CAS |