bugGNU Octave - Bugs: bug #46367, spurious tick labels with...

 
 

bug #46367: spurious tick labels with "YTickLabel", []

Submitter:  ederag <ederag>
Submitted:  Mon 02 Nov 2015 08:02:35 PM UTC
   
 
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 14 Dec 2015 12:45:26 PM UTC, comment #11: 

Confirmed, it works, thanks for pushing !

Usually devs just copy/paste the "from" field of the corresponding mail. No need for an upper case first letter. But really never mind this time. It's just a pseudo anyway :-)

ederag <ederag>
Sun 13 Dec 2015 10:43:00 PM UTC, comment #10: 

I pushed the changeset. My apologies, after pushing I noticed I misspelled your alias.

Once the fix is confirmed, this can be closed.

Ben Abbott <bpabbott>
Group Member
Sun 13 Dec 2015 08:19:09 PM UTC, comment #9: 

@ederag

I'm ready to push this one. If you'll provide us your full name, I'll have it committed in your name.

Ben Abbott <bpabbott>
Group Member
Sat 07 Nov 2015 03:40:44 PM UTC, comment #8: 

I also think that your patch should be applied.

@devs: please review (and push) the patch in comment #3.

@edarag: in comment #6 it should be "Yes, you are right"

Avinoam Kalma <avinoam>
Group Member
Sat 07 Nov 2015 01:11:48 PM UTC, comment #7: 

i do agree that setting ticks together with the right format at once would be better.
But this is not a trivial change, given the current code structure.

I would vote to keep my minimal change (in comment #3), that does fix the bug.

ederag <ederag>
Sat 07 Nov 2015 11:29:59 AM UTC, comment #6: 

Yes, I are right, my mistake.

set(h, "YTickLabel", []);

should be translated for gnuplot toolkit to

set ytics format ""

This will keep the tick marks, with empty labels.

But... such change will require to set again the format in every
tics change

Avinoam Kalma <avinoam>
Group Member
Fri 06 Nov 2015 05:01:58 PM UTC, comment #5: 

Thanks for taking time to explain better the origin of the bug.
But "unset ytics" would remove tics altogether, wouldn't it ?
We do want ticks, just without tick labels.
So just "unset ytics", without a new "set ytics ..." would'nt be enough. Am I missing something ?

ederag <ederag>
Thu 05 Nov 2015 09:43:06 PM UTC, comment #4: 

Checking the gnuplot file generated by Octave shows that the origin of the spurious tick label is the first command that puts the labels in places

7.000000000000001e-001, 7.500000000000000e-001, 8.000000000000000e-001, 8.500000000000001e-001, 9.000000000000000e-001, 9.500000000000001e-001

and the second lines puts the empty ticks in the correct places,
but since 7.000000000000001e-001 is not 7.000000000000000e-001,
this label is not erased.

The change of format from %.15e to %.15g fix thised,
but I think that another fix is needed: in the case of

set(h, "YTickLabel", []);

there should be "unset ytics" instead of setting a lot of empty ticks.

Avinoam Kalma <avinoam>
Group Member
Tue 03 Nov 2015 02:10:11 AM UTC, comment #3: 

Actually "%g" lacks precision:

>> sprintf("%g", pi)
ans = 3.14159
>> sprintf("%.15g", pi)
ans = 3.14159265358979


Please find attached a better patch, using %.15g



(file #35370)

ederag <ederag>
Mon 02 Nov 2015 08:27:58 PM UTC, comment #2: 

And the patch.

There are other %.15e left. If there are other slight mismatches, they could be worth investigating.

(file #35369)

ederag <ederag>
Mon 02 Nov 2015 08:19:45 PM UTC, comment #1: 

Here is the wrong output

(file #35368)

ederag <ederag>
Mon 02 Nov 2015 08:02:35 PM UTC, original submission:  

When setting ticks and removing tick labels, sometimes there are spurious tick labels left, for instance:


graphics_toolkit("gnuplot")
h = axes;
yticks = 0:0.05:10;
set(h, "ytick", yticks)
set(h, "YTickLabel", []);


This has been tested with octave dev, changeset 20679:7ae6bbf0a567
To be precise, my patches given in
https://savannah.gnu.org/bugs/?46292#comment10
have been applied, but they should not interfere with this one.

The patch is following, as soon as I have the bug number.

ederag <ederag>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #35369:  octave-4.1.0+__gnuplot_draw_axes__.m.patch added by ederag (1KiB - text/x-patch - hg export)
file #35368:  wrong_15b01aa.eps added by ederag (24KiB - image/x-eps - The wrong output)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bpabbott (Posted a comment)
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by ederag (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-12-15 bpabbott StatusReady For Test Confirmed
        Open/ClosedOpen Closed
    2015-12-13 bpabbott StatusNone Ready For Test
    2015-11-03 ederag Attached File- Added octave-4.1.0+__gnuplot_draw_axes__.m.patch, #35370
    2015-11-02 ederag Attached File- Added octave-4.1.0+__gnuplot_draw_axes__.m.patch, #35369
    2015-11-02 ederag Attached File- Added wrong_15b01aa.eps, #35368

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code