bugGNU Octave - Bugs: bug #42947, gnuplot doesn't color tick marks...

 
 

bug #42947: gnuplot doesn't color tick marks with axis color property

Submitter:  Rik <rik5>
Submitted:  Fri 08 Aug 2014 04:26:22 PM UTC
   
 
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 02 Jul 2016 02:12:32 AM UTC, comment #17: 

Retagging as "fixed".  Can this now be closed?

Lachlan Andrew <lachlan>
Sun 28 Feb 2016 02:20:46 AM UTC, comment #16: 

@Ben: Works fine now.  Thanks.

Rik <rik5>
Group administrator
Sun 28 Feb 2016 01:13:39 AM UTC, comment #15: 

Rik,

I pushed a fix. Please verify it works for you with gnuplot 4.6

http://hg.savannah.gnu.org/hgweb/octave/rev/df5922f77193


Ben Abbott <bpabbott>
Group Member
Sat 27 Feb 2016 01:33:10 PM UTC, comment #14: 

Ugggh! I had worked on this patch prior to realizing that "dashtype" was new syntax. A feature check for dashtype needs to be added. That will be useful for implementing consistent dashtypes across all gnuplot terminals later.

Ben Abbott <bpabbott>
Group Member
Sat 27 Feb 2016 05:50:05 AM UTC, comment #13: 

Just an FYI, I have no problems with gnuplot 5.0, but if I run with gnuplot 4.6.6 I get the following errors


plot (1:10, ':')

gnuplot> set arrow 1 nohead nofilled front dashtype solid lc rgb "#000000" linewidth 0.500 from graph 0,0,0 to graph 1,0,0
                                           ^
         line 0: wrong argument in set arrow


gnuplot> set arrow 2 nohead nofilled front dashtype solid lc rgb "#000000" linewidth 0.500 from graph 0,1,0 to graph 1,1,0
                                           ^
         line 0: wrong argument in set arrow


gnuplot> set arrow 3 nohead nofilled front dashtype solid lc rgb "#000000" linewidth 0.500 from graph 0,0,0 to graph 0,1,0
                          octave:4>                  ^
         line 0: wrong argument in set arrow


gnuplot> set arrow 4 nohead nofilled front dashtype solid lc rgb "#000000" linewidth 0.500 from graph 1,0,0 to graph 1,1,0
                                           ^
         line 0: wrong argument in set arrow


Rik <rik5>
Group administrator
Sat 27 Feb 2016 03:12:13 AM UTC, comment #12: 

@Ben: I applied your patch here (http://hg.savannah.gnu.org/hgweb/octave/rev/ad07ed235053). 

I re-titled the bug report to mention the remaining issue about tick marks not being colored correctly.

Rik <rik5>
Group administrator
Sat 27 Feb 2016 01:55:29 AM UTC, comment #11: 

Opps. I looked at the wrong patch. The clean up is rather obvious (at least the commented lines). Please take a quick look at the attached one.

(file #36483)

Ben Abbott <bpabbott>
Group Member
Sat 27 Feb 2016 12:53:05 AM UTC, comment #10: 

It looks like you simply commented out lines that were unneeded, rather than deleting them.  That left a whole lot of fputs and fprintf statements with '#' in front of them.

The second item was to check that all statements end in ';' so that output is suppressed.  It doesn't actually matter for fprintf, but its nicer to have it conform with the rest of the code.

Rik <rik5>
Group administrator
Sat 27 Feb 2016 12:44:25 AM UTC, comment #9: 

Ok. Regarding the clean up, what caught your attention?

Ben Abbott <bpabbott>
Group Member
Fri 26 Feb 2016 10:08:09 PM UTC, comment #8: 

@Ben: Apparently a few days stretch in to two months.  I checked the patch and it works as far as it goes.  That is, it colors the axis of 2-D plots, but tick marks are still uncolored and 3-D plots are also uncolored.

Do you want to clean it up and apply it?

Rik <rik5>
Group administrator
Tue 29 Dec 2015 04:11:25 PM UTC, comment #7: 

@Ben: I'm busy today, but I'll try to review within the next couple of days.

Rik <rik5>
Group administrator
Tue 29 Dec 2015 12:37:21 AM UTC, comment #6: 

Opps, attaching the correct changeset

(file #35882)

Ben Abbott <bpabbott>
Group Member
Tue 29 Dec 2015 12:35:45 AM UTC, comment #5: 

I found a bug in the changeset. I'm attached a modified changeset and a modified demo.

(file #35880, file #35881)

Ben Abbott <bpabbott>
Group Member
Mon 28 Dec 2015 07:16:54 PM UTC, comment #4: 

I'm attaching a proposal for 2D plots. This changeset does not color the tic-marks, but does color the axes. I'm also attaching a demo script.

@Rik, do you think the proposed changeset is acceptable?

(file #35876, file #35877)

Ben Abbott <bpabbott>
Group Member
Mon 28 Dec 2015 01:39:05 AM UTC, comment #3: 

I found a clumsy solution which might work if _gnuplot_draw_axes_ isn't making use of "set arrow N ...", or if the arrow indexing is handled properly. Below is a simple gnuplot scrip that colors the axes for 2D plot.


reset
unset key

set style line 1 linecolor rgb "blue"    linewidth 1 dashtype solid pointtype 1 pointsize default pointinterval 0
set style line 2 linecolor rgb "#006400" linewidth 1 dashtype solid pointtype 1 pointsize default pointinterval 0
set style line 3 linecolor rgb "red"     linewidth 1 dashtype solid pointtype 1 pointsize default pointinterval 0

set border 0
set arrow 1 nohead nofilled front lc rgb "#006400" linewidth 1 dashtype solid from graph 0,0,0 to graph 1,0,0
set arrow 2 nohead nofilled front lc rgb "blue"  linewidth 1 dashtype solid from graph 0,0,0 to graph 0,1,0
set arrow 3 nohead nofilled front lc rgb "black" linewidth 1 dashtype solid from graph 0,1,0 to graph 1,1,0
set arrow 4 nohead nofilled front lc rgb "red"   linewidth 1 dashtype solid from graph 1,0,0 to graph 1,1,0

set y2tics nomirror textcolor rgb "red" format "10^{%T}"
set ytics nomirror textcolor rgb "blue" format "%.1f"
set xtics nomirror textcolor rgb "#006400" format "%g"
set xlabel 'x' textcolor rgb "#006400"
set ylabel 'sin(x)' textcolor rgb "blue"
set y2label 'exp(x)|sin(x)|' textcolor rgb "red"
set log y2
set sample 1000
plot sin(x) with lines ls 1 axes x1y1, exp(x)*abs(sin(x)) with lines ls 3 axes x1y2


This example creates a blue y-axis, a red y2-axis, a green x-axis, and a black x2-axis.

Ben Abbott <bpabbott>
Group Member
Sun 27 Dec 2015 11:11:17 PM UTC, comment #2: 

For the case of the axes being drawn along (x,0,0), (0,y,0) or (0,0,z) the gnuplot command "set *zeroaxes" can be used.


set {x|x2|y|y2|z}zeroaxis { {linestyle | ls <line_style>}
                           | { linetype | lt <line_type>}
                             { linewidth | lw <line_width>}}
unset {x|x2|y|y2|z}zeroaxis
show {x|y|z}zeroaxis


http://www.bersch.net/gnuplot-doc/set-show.html#set-zeroaxis

Unfortunately, I don't see an alternative for doing the same for the border of a plot.

Ben Abbott <bpabbott>
Group Member
Sat 26 Dec 2015 01:20:20 AM UTC, comment #1: 

I tried changing the plot box border color using gnuplot. I didn't get a result that makes sense to me. I'm attaching the gnuplot script and the png it produced.

Short story, it appears that only one color may be used for the plot box border.

Perhaps this bug should have a status of "Won't Fix"?

(file #35857,

Ben Abbott <bpabbott>
Group Member
Fri 08 Aug 2014 04:26:22 PM UTC, original submission:  

The axis line, tick marks, and tick labels should all be controlled by the axis property 'xcolor', 'ycolor', or 'zcolor'.

With the gnuplot toolkit, only the ticklabels have their color changed.

Sample code:


graphics_toolkit gnuplot
plot (1:10);
set (gca, "xcolor", "r");



Rik <rik5>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #36483:  changeset.patch added by bpabbott (5KiB - application/octet-stream)
file #35882:  changeset.patch added by bpabbott (6KiB - application/octet-stream)
file #35881:  demo_42947.m added by bpabbott (754B - application/octet-stream)
file #35857:  42947.gp added by bpabbott (504B - application/octet-stream)
file #35858:  42947.png added by bpabbott (31KiB - image/png)

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by lachlan (Posted a comment)
  • -email is unavailable- added by bpabbott (Updated the item)
  • -email is unavailable- added by avinoam
  • -email is unavailable- added by rik5 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 17 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-10-05 rik5 Dependencies- bugs #52169 is dependent
    2016-07-02 rik5 Open/ClosedOpen Closed
    2016-07-02 lachlan StatusPatch Submitted Fixed
    2016-02-27 rik5 Summarygnuplot doesn\'t color axis line and tick marks with axis color property gnuplot doesn't color tick marks with axis color property
    2016-02-27 bpabbott Attached File- Added changeset.patch, #36483
    2016-02-26 rik5 StatusNone Patch Submitted
    2015-12-29 bpabbott Attached File- Added changeset.patch, #35882
    2015-12-29 bpabbott Attached File#35877 Removed
    2015-12-29 bpabbott Attached File#35876 Removed
    2015-12-29 bpabbott Attached File#35880 Removed
    2015-12-29 bpabbott Attached File- Added 42947-border2.diff, #35880
        Attached File- Added demo_42947.m, #35881
    2015-12-28 bpabbott Attached File- Added changeset.patch, #35876
        Attached File- Added demo_42947.m, #35877
    2015-12-26 bpabbott Attached File- Added 42947.gp, #35857
        Attached File- Added 42947.png, #35858
    2014-11-14 avinoam Carbon-Copy- Added avinoam

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code