bugGNU Octave - Bugs: bug #33869, minor ticks disappear from log...

 
 

bug #33869: minor ticks disappear from log plot with specified xticklabels

Submitted by:  Ben Abbott <bpabbott>
Submitted on:  Wed 27 Jul 2011 12:11:11 PM UTC  
 
Category: Plotting with gnuplotSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: Ben Abbott <bpabbott>
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)

Wed 13 Mar 2013 10:28:09 PM UTC, comment #11:

Fixed 6 months ago. Closing report.

Rik <rik5>
Project Administrator
Wed 21 Nov 2012 12:56:39 PM UTC, comment #10:

I pushed a changsetset.

http://hg.savannah.gnu.org/hgweb/octave/rev/25db7d506d12

I'll leave this open to encourage testing.

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
Wed 21 Nov 2012 12:51:50 PM UTC, comment #9:

Its unexpected, but for pdfwrite output I do see that difference between using %g and omitting the "set format" statement and using the default (again %g). I've attached two files for anyone who is interested (the displayed "qt" terminal does not show a difference).

(file #26949, file #26950)

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
Wed 21 Nov 2012 08:46:34 AM UTC, comment #8:

Ben,

I would also say that it shouldn't matter if you explicitly set "%g" as the y-axis format or if you omit it. Since "%g" is the default, and in gnuplot "show format" confirms that this is indeed set.

The odd thing is that when I test it, it does matter. The y-axis is still shifted slightly more to the right when setting "%g" is omitted (as file #26945 does) compared to setting "%g".

The exact code I use to test this is:

With the above code and file #26921 applied, setting "%s" moves the y-axis the most to the right, omitting the line (as file #26945 does) a little less, and setting "%g" (patch in comment #5) gives the least amount of y-axis movement which works best for me. So file #26945 doesn't really work for me.

The change you pushed (file #26921) does indeed fix minor grid/ticks when setting xticklabels, but as stated above introduces disproportional movement of the y-axis when setting the yticklabels.

Ronald <revdmeer>
Wed 21 Nov 2012 12:29:13 AM UTC, comment #7:

Ronald,

I pushed the changeset that fixes the minor grid.

http://hg.savannah.gnu.org/hgweb/octave/rev/81db2aca1a84

Does the attached changeset work for you?

(file #26945)

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
Wed 21 Nov 2012 12:02:22 AM UTC, comment #6:

Ronald,

The format options for gnuplot are at the link below.

http://www.gnuplot.info/docs_4.2/gnuplot.html#x1-18600043.21.2

As the "%s" to "%g" change is unrelated to this bug, I think it best to propose a second changeset for that purpose.

In any event, rather than changing the format from "%s" to "%g" should the format statement just be omitted when the tick labels are specified as a cellstring array?

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
Tue 20 Nov 2012 03:30:12 PM UTC, comment #5:

Ben,

My name is written with lower case "v" and "d". Otherwise it's correct.

I do notice a side-effect of my previous patch. The Y axis moves right more than needed because of this patch after setting manual yticklabels. This creates a large amount of white space between the ylabel and the axis labels.

The gnuplot command 'set format y "%s"' seems to trigger this. Changing this to (the default) %g prevents this. Again I'm just poking around here trying to force the behavior I want. I do not really understand the details of the gnuplot nor the octave plotting mechanisms.

So my patch to /usr/share/octave/3.6.1/m/plot/private/__go_draw_axes__.m now is:

Ronald <revdmeer>
Thu 15 Nov 2012 11:41:48 PM UTC, comment #4:

Ronald,

I've attached a changeset attributed to you. If you can confirm I got your name correct, I'll push the changeset.

(file #26921)

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
Thu 15 Nov 2012 09:43:55 AM UTC, comment #3:

I may have a simple solution.

Using the add keyword with set ytics in gnuplot preserves any existing ticks, including the minor ticks. See:
http://gnuplot.sourceforge.net/docs_4.2/node295.html

If you set the ticks using the add keyword on the exact positions of all the old ticks, they will be overwritten. It seems to me that octave does this anyway, so just adding the add keyword may be a valid solution.

I did this patch on /usr/share/octave/3.6.1/m/plot/private/__go_draw_axes__.m :
It works for me. Minor ticks and minor grid are now still present after manually setting the ticklabels without any side-effects so far.

Ronald <revdmeer>
Thu 10 May 2012 08:36:06 AM UTC, comment #2:

I too ran into this issue in octave and gnuplot. (gnuplot 4.4 patchlevel 4 and octave 3.6.1). I found this behavior to be the same with linear plots. For me it was the minor grid (which is linked to the minor ticks) that disappeared e.g:

plot(0:1:10,0:1:10)
grid minor on %minor grid appears as expected
set (gca(), "xticklabel", {'0', '2', '4', '6', '8', '10'}) %x minor grid disappeares
set (gca(), "yticklabel", {'0', '2', '4', '6', '8', '10'}) %y minor grid disappeares as well

After some fiddling around in gnuplot I came to conclude that apparently you no longer get to enjoy automatic "mytics" when you "set ytics". When you want minor tics you have to specify them in "set ytics" with a trailing "1" which indicates a minor-tics. In your gnuplot example this would be something like (for minor ticks inbetween 10^-4 and 10^-3:

set ytics ("10^{-4}" 1e-4, "" 2e-4 1, "" 3e-4 1, "" 4e-4 1, "" 5e-4 1, "" 6e-4 1, "" 7e-4 1, "" 8e-4 1, "" 9e-4 1, "" 1e-3, "" 2e-3 1, "" 3e-3 1, "" 4e-3 1, "" 5e-3 1, "" 6e-3 1, "" 7e-3 1, "" 8e-3 1, "" 9e-3 1, "10^{-2}" 1e-2, "10^{0}" 1, "10^{2}" 1e2, "10^{4}" 1e4)

I'm guessing this is intended behavior of gnuplot, in which case octave should work around it by specifying the minor ticks with "set ytics" or "set xtics" when ticklabels are set and minor ticks are expected.

Ronald <revdmeer>
Sun 02 Oct 2011 09:45:38 PM UTC, comment #1:

I did some tests in gnuplot, but haven't been able to have minor ticks show up when the tick labels are defined. Example, below.

Looks like I'm in need of some help.

Can someone can point out what is wrong with this these commands?

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
Wed 27 Jul 2011 12:11:11 PM UTC, original submission:

The command below produce a plot with minor ticks.

If the xticklabels are set manually, then the minor ticks disappear.

Ben Abbott <bpabbott>
Project MemberIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #26949:  %g_format.pdf added by bpabbott (4KiB - application/pdf)
file #26950:  no_format.pdf added by bpabbott (4KiB - application/pdf)
file #26945:  changeset.patch added by bpabbott (864B - application/octet-stream)
file #26921:  changeset.patch added by bpabbott (1KiB - application/octet-stream)

 

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 revdmeer (Posted a comment)
  • -unavailable- added by bpabbott (Submitted the item)
  • -unavailable- added by bpabbott
  •  

    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 11 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 13 Mar 2013 10:28:09 PM UTCrik5StatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Wed 21 Nov 2012 12:51:50 PM UTCbpabbottAttached File-=>Added %g_format.pdf, #26949
      Attached File-=>Added no_format.pdf, #26950
    Wed 21 Nov 2012 12:29:13 AM UTCbpabbottAttached File-=>Added changeset.patch, #26945
      StatusPatch Submitted=>Ready For Test
    Sun 18 Nov 2012 12:52:31 AM UTCbpabbottOperating SystemMac OS=>Any
    Thu 15 Nov 2012 11:41:48 PM UTCbpabbottAttached File-=>Added changeset.patch, #26921
      StatusNone=>Patch Submitted
      Assigned toNone=>bpabbott
    Wed 27 Jul 2011 12:11:11 PM UTCbpabbottCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1