[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
respecting the linewidth, etc with gnuplot 4.0
From: |
David Bateman |
Subject: |
respecting the linewidth, etc with gnuplot 4.0 |
Date: |
Tue, 27 Mar 2007 11:44:48 +0200 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20060921) |
Can you consider the attached patch. It makes octave pass the linewidth,
markersize, and marker variables to the plotting command itself rather
than the "set style" command. This has the effect of allowing octave to
support the setting of the line width, marker size etc with older
versions of gnuplot..
Regards
David
--
David Bateman address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
*** ./scripts/plot/__go_draw_axes__.m.orig64 2007-03-27 03:10:54.000000000
+0200
--- ./scripts/plot/__go_draw_axes__.m 2007-03-27 11:40:25.281890020 +0200
***************
*** 342,348 ****
else
titlespec{data_idx} = strcat ("title \"", obj.keylabel, "\"");
endif
! [style, typ] = do_linestyle_command (obj, data_idx, plot_stream);
usingclause{data_idx} = "";
if (have_newer_gnuplot || isnan (typ))
withclause{data_idx} = sprintf ("with %s linestyle %d",
--- 342,348 ----
else
titlespec{data_idx} = strcat ("title \"", obj.keylabel, "\"");
endif
! [style, typ, with] = do_linestyle_command (obj, data_idx,
plot_stream);
usingclause{data_idx} = "";
if (have_newer_gnuplot || isnan (typ))
withclause{data_idx} = sprintf ("with %s linestyle %d",
***************
*** 450,459 ****
usingclause{data_idx} = "using ($1):($2)";
endif
endif
case "surface"
data_idx++;
! [style, typ] = do_linestyle_command (obj, data_idx, plot_stream);
filespec{data_idx} = "-";
if (isempty (obj.keylabel))
titlespec{data_idx} = "title \"\"";
--- 450,467 ----
usingclause{data_idx} = "using ($1):($2)";
endif
endif
+ if (!have_newer_gnuplot && ! isempty(with))
+ if (isempty(withclause{data_idx}))
+ withclause{data_idx} = sprintf("with %s", with);
+ else
+ withclause{data_idx} = sprintf("%s %s",
+ withclause{data_idx}, with);
+ endif
+ endif
case "surface"
data_idx++;
! [style, typ, with] = do_linestyle_command (obj, data_idx,
plot_stream);
filespec{data_idx} = "-";
if (isempty (obj.keylabel))
titlespec{data_idx} = "title \"\"";
***************
*** 465,472 ****
withclause{data_idx} = sprintf ("with %s linestyle %d",
style, data_idx);
else
! withclause{data_idx} = sprintf ("with %s linetype %d",
! style, typ);
endif
parametric(i) = false;
nd = 3;
--- 473,480 ----
withclause{data_idx} = sprintf ("with %s linestyle %d",
style, data_idx);
else
! withclause{data_idx} = sprintf ("with %s linetype %d %s",
! style, typ, with);
endif
parametric(i) = false;
nd = 3;
***************
*** 752,758 ****
endfunction
! function [style, typ] = do_linestyle_command (obj, idx, plot_stream)
persistent have_newer_gnuplot ...
= compare_versions (__gnuplot_version__ (), "4.0", ">");
--- 760,766 ----
endfunction
! function [style, typ, with] = do_linestyle_command (obj, idx, plot_stream)
persistent have_newer_gnuplot ...
= compare_versions (__gnuplot_version__ (), "4.0", ">");
***************
*** 764,769 ****
--- 772,778 ----
found_style = false;
typ = NaN;
+ with = "";
if (isfield (obj, "color"))
color = obj.color;
***************
*** 820,826 ****
endif
if (isfield (obj, "linewidth"))
! fprintf (plot_stream, " linewidth %f", obj.linewidth);
found_style = true;
endif
--- 829,839 ----
endif
if (isfield (obj, "linewidth"))
! if (have_newer_gnuplot)
! fprintf (plot_stream, " linewidth %f", obj.linewidth);
! else
! with = [with," lw ", num2str(obj.linewidth)];
! endif
found_style = true;
endif
***************
*** 858,875 ****
pt = "";
endswitch
if (! isempty (pt))
! fprintf (plot_stream, " pointtype %s", pt);
found_style = true;
endif
else
pt = "";
endif
- if (isfield (obj, "markersize"))
- fprintf (plot_stream, " pointsize %f", obj.markersize);
- found_style = true;
- endif
-
style = "lines";
if (isempty (lt))
if (! isempty (pt))
--- 871,887 ----
pt = "";
endswitch
if (! isempty (pt))
! if (have_newer_gnuplot)
! fprintf (plot_stream, " pointtype %s", pt);
! else
! with = [with," pt ", pt];
! endif
found_style = true;
endif
else
pt = "";
endif
style = "lines";
if (isempty (lt))
if (! isempty (pt))
***************
*** 879,884 ****
--- 891,907 ----
style = "linespoints";
endif
+ if (isfield (obj, "markersize"))
+ if (have_newer_gnuplot)
+ fprintf (plot_stream, " pointsize %f", obj.markersize);
+ else
+ if (!strcmp(style,"lines"))
+ with = [with," ps ",num2str(obj.markersize)];
+ endif
+ endif
+ found_style = true;
+ endif
+
if (have_newer_gnuplot && ! found_style)
fputs (plot_stream, " default");
endif
- respecting the linewidth, etc with gnuplot 4.0,
David Bateman <=