bugGNU Octave - Bugs: bug #46886, linetype not respected across...

 
 

bug #46886: linetype not respected across gnuplot terminals

Submitted by:  Ben Abbott <bpabbott>
Submitted on:  Wed 13 Jan 2016 12:38:00 AM UTC  
 
Category: Plotting with gnuplotSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Ben AbbottOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Thu 10 Mar 2016 01:46:50 AM UTC, comment #12:

Rik,

I've pushed two changesets. I'll work on restoring support for gnuplot 4.6.x as time permits.

Ben Abbott <bpabbott>
Project Member
Thu 10 Mar 2016 12:53:25 AM UTC, comment #11:

Rik, of course my changeset only addresses dashtypes for gnuplot 5.

I'm worried that we have introduced many bugs for gnuplot 4.6.x.

I'll work on testing and fixing as time permits. I'll first have to manage an install of gnuplot 4.6.x.

Ben Abbott <bpabbott>
Project Member
Wed 09 Mar 2016 11:41:16 PM UTC, comment #10:

Ben, overall the changeset looks good. Here is my modified script that I used to test your patch:

I added a title() call so that I could quickly see which terminal was producing which set of lines. Under gnuplot 5, they all seem to look more or less the same. Under gnuplot 4.6.6 all of the lines are solid. This is unrelated to your patch. Apparently Octave has lost the ability to plot different line types when the version is less than 5.

I would say go ahead and commit it.

Also, I tried running some of the graphic demos under gnuplot and I'm getting different results than qt or fltk. A while back we had a test script that ran all the demos under gnuplot, fltk, qt, and matlab. It seems like it is time to dust that off and run it again.

The first thing I see is that 'shading interp' seems to be broken on gnuplot. Also, when I run 'demo ("contour3", 1)' I get this

All of this could go under a new bug report if you like.

Rik <rik5>
Project Administrator
Wed 09 Mar 2016 12:58:56 PM UTC, comment #9:

Rik,

Have you tried different terminal types with 2D plots? Below is a script that works for me. You'll need to delete "aqua".

I no longer have a gnuplot 4.6 to run. For gnuplot 5, this produces different linestyles for the terminals. However, I have a patch that fixes that (it is attached).

Sorry for cross-posting on the bug reports, but I posted to the wrong one first.

(file #36580)

Ben Abbott <bpabbott>
Project Member
Mon 29 Feb 2016 03:43:20 AM UTC, comment #8:

I applied Dan's patch for bug #34523. I think you can move ahead with your patch for consistency.

FYI, linestyle seems to be broken for gnuplot 4.6.6 and 2-D plots now. For example, "plot (1:10, 'o--')" does not produce a line with breaks--it is solid.

Rik <rik5>
Project Administrator
Mon 29 Feb 2016 02:32:44 AM UTC, comment #7:

opps, the gnuplot syntax wasn't quite equivalent to Octave's linestyles. The ones below are better suited.

Ben Abbott <bpabbott>
Project Member
Mon 29 Feb 2016 02:27:34 AM UTC, comment #6:

I've updated Dan's patch and attached it to bug #34523.

I also stumbled across syntax options for gnuplot's "dashtype" that I was not aware of.

With the exception of ":", Octave's linestyles can be easily rendered using gnuplot by specifying the dashtype to be the linestyle

Once Dan's patch is committed, it should be rather easy to create a patch that produces consistent linestyles across gnuplot's terminals.

Ben Abbott <bpabbott>
Project Member
Mon 29 Feb 2016 12:36:32 AM UTC, comment #5:

It appears that Dan has already coded a patch that does most of this at bug #34523. Unfortunately the patch no longer applies cleanly against the current dev branch.

Rik <rik5>
Project Administrator
Fri 26 Feb 2016 10:02:22 PM UTC, comment #4:

Yes. I noticed that gnuplot 5 now supports consistent dashtypes across terminals. I haven't had the time to estimate how much of the code needs to be changed, but am optimistic about the idea.

BTW, the fix for Aquaterm has been applied to the official Gnuplot code. Thus aqua, qt, wxt, and x11 can each produce results that are consistent with postscript.

Ben Abbott <bpabbott>
Project Member
Fri 26 Feb 2016 09:52:41 PM UTC, comment #3:

@Ben: Is this a placeholder bug report?

It seems that gnuplot 5 supports a "dashtype" option, but no one has coded _gnuplot_has_feature_ to be able to check for its existence. Nor has _gnuplot_draw_axes_ been modified to make use of it.

Rik <rik5>
Project Administrator
Wed 13 Jan 2016 08:19:50 PM UTC, comment #2:

Presently, the gnuplot linestyles are used and matched up to Octave/Matlab lifestyles. Below is a code snippet from _gnuplot_draw_axes_

The "lt" variable refers to gnuplot's line style index number

You'll notice that gnuplot's line style does not allow the dash/dot sequence to be modified. In addition, each of gnuplot's terminals can have different dash/dot sequences for their line styles (i.e. no required consistency).

With the new "dash type", it is now possible to ensure the line styles are consistent across all terminals. I've attached four test pngs using the terminals aqua, qt, wxt, and x11. These were produced using gnuplot 5.0.2 with a patch to permit user defined dash types when using AquaTerm.

(file #36017, file #36018, file #36019, file #36020)

Ben Abbott <bpabbott>
Project Member
Wed 13 Jan 2016 05:18:39 PM UTC, comment #1:

What is the proposed change for Octave? Currently linestyles do seem to work already. I used the test code below with gnuplot 4.6.7.

Rik <rik5>
Project Administrator
Wed 13 Jan 2016 12:38:00 AM UTC, original submission:

With gnuplot v5, it is now possible to specify a "dashtype"

http://www.bersch.net/gnuplot-doc/linetypes,-colors,-and-styles.html#dashtype

This syntax is intended to function across all terminals, and can be used to provide Matlab compatible linestyle for Octave.

Ben Abbott <bpabbott>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #36580:  changeset.patch added by bpabbott (1KiB - application/octet-stream)
file #36017:  aqua.png added by bpabbott (96KiB - image/png)
file #36018:  wxt.png added by bpabbott (98KiB - image/png)
file #36019:  qt.png added by bpabbott (120KiB - image/png)
file #36020:  x11.png added by bpabbott (38KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by bpabbott (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 10 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 10 Mar 2016 01:59:56 AM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Wed 09 Mar 2016 11:41:16 PM UTCrik5Summarylinetype not respected across Gnuplot terminals=>linetype not respected across gnuplot terminals
    Wed 09 Mar 2016 12:58:56 PM UTCbpabbottAttached File-=>Added changeset.patch, #36580
    Sun 28 Feb 2016 04:17:38 PM UTCrik5StatusNeed Info=>Confirmed
    Wed 13 Jan 2016 08:19:50 PM UTCbpabbottAttached File-=>Added aqua.png, #36017
      Attached File-=>Added wxt.png, #36018
      Attached File-=>Added qt.png, #36019
      Attached File-=>Added x11.png, #36020
    Wed 13 Jan 2016 05:18:39 PM UTCrik5StatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1