octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #48982] line drawing not compatible with gnupl


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #48982] line drawing not compatible with gnuplot version 4.4.0
Date: Sat, 3 Sep 2016 00:32:49 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0

Follow-up Comment #5, bug #48982 (project octave):

Yeah, the {} empty cell notation, analogous to [] from way back...

I think I see what the issue is, and it is a bit confusing because of the
gnuplot syntax.

First, let me point out where the problem lies.  This change that causes lines
to appear properly, but not of the dash illustrates:


diff --git a/scripts/plot/util/private/__gnuplot_draw_axes__.m
b/scripts/plot/ut
--- a/scripts/plot/util/private/__gnuplot_draw_axes__.m
+++ b/scripts/plot/util/private/__gnuplot_draw_axes__.m
@@ -1978,7 +1978,7 @@ function [style, ltidx] = do_linestyle_c
 
   sidx = 1;
   if (isempty (errbars))
-    if (isempty (lt))
+    if (isempty (lt) && __gnuplot_has_feature__ ("linetype"))
       style{sidx} = "";
     else
       style{sidx} = "lines";


I think that gnuplot_linetype() should probably return something even if there
is no dashtype feature or there is no linetype feature (but hold on,
"linetype" is the confusion).

I look at gnuplot_linetype() and I see


    elseif (__gnuplot_has_feature__ ("linetype"))
      opt = "linetype";
      switch (obj.linestyle)
        case "-"
          lt = "1";
        case "--"
          lt = "2";
        case ":"
          lt = "3";
        case "-."
          lt = "6";
        case "none"
          lt = "";
        otherwise
          lt = "";
      endswitch
    else
      lt = "";
    endif
    if (! isempty (lt))
      lt = sprintf ("%s %s", opt, lt);
    endif


There are two occurrences of "linetype" at the start of the above hunk, but I
think they refer to two different gnuplot concepts.  The
__gnuplot_has_feature__ I believe refers to "linetype" as an alternative to
"linestyle", while the "opt" linetype is a qualifier for a line style.  That
is, in gnuplot 4.4.0 there is no valid

set linetype 9 default;

, for example, but there is a valid qualifier "linetype" in the plot command


       set style line <index> {{linetype  | lt} <line_type> | <colorspec>}
                              {{linecolor | lc} <colorspec>}
                              {{linewidth | lw} <line_width>}
                              {{pointtype | pt} <point_type>}
                              {{pointsize | ps} <point_size>}
                              {{pointinterval | pi} <interval>}
                              {palette}


So, we have double meaning for "linetype", but of course the
__gnuplot_has_feature__ can't distinguish between what is being referred to.

Either we have to get more granular on "linetype" within
__gnuplot_has_feature__, e.g., "linetype" and "stylelinetype", or we can just
assume that the "linetype" option has always existed and just do:


diff --git a/scripts/plot/util/private/__gnuplot_draw_axes__.m
b/scripts/plot/ut
--- a/scripts/plot/util/private/__gnuplot_draw_axes__.m
+++ b/scripts/plot/util/private/__gnuplot_draw_axes__.m
@@ -2107,7 +2107,7 @@ function [lt] = gnuplot_linetype (obj)
         otherwise
           lt = "";
       endswitch
-    elseif (__gnuplot_has_feature__ ("linetype"))
+    else
       opt = "linetype";
       switch (obj.linestyle)
         case "-"
@@ -2123,8 +2123,6 @@ function [lt] = gnuplot_linetype (obj)
         otherwise
           lt = "";
       endswitch
-    else
-      lt = "";
     endif
     if (! isempty (lt))
       lt = sprintf ("%s %s", opt, lt);


The only other place that gnuplot_linetype() is used is for patch outlines. 
We should somehow comment, or actually better would be to change the name of
"gnuplot_linetype()" to clear confusion.  In the attached patch I've done just
that...think it over I guess.  If you want to add something new to
__gnuplot_has_feature__, I'll look how far back "linetype" has been a valid
"line style" qualifier.

I verified that the changeset also works for the line style around patches.

(file #38419)
    _______________________________________________________

Additional Item Attachment:

File name: octave-gnuplot_linestyletype_bug48982-djs2016sep02.patch Size:2 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48982>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]