bugGNU Octave - Bugs: bug #55864, semilogy plot ticks could be too...

 
 

bug #55864: semilogy plot ticks could be too dense or too sparse

Submitted by:  Eddy <count>
Submitted on:  Fri 08 Mar 2019 01:38:25 PM UTC  
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sun 10 Mar 2019 03:21:50 PM UTC, comment #1:

Found a related issue:

bug #55640: Feature Request: Adjust tick locations and labels based on text extents and size of axes

If the workaround here could be implemented, or better, further provide user the ability to control (set () ?) the density of ticks/grids, then #55640 would be largely solved.

I attached an updated Octave scripts for computing the ticks and bounds (calc_axis_ticks.m), and also the demo file bug_demo_fix.m that solve the too dense or too sparse problem. (See bug #55876 for some flaw)

addlistener(gca, 'xlim', ...) seems not work well, so the true solution still need in the C++ part.

(file #46488, file #46489, file #46490)

Eddy <count>
Fri 08 Mar 2019 01:38:25 PM UTC, original submission:

When semilogy plot hugely scaled data, or tiny scaled data, the ticks can be too dense or too sparse.

This, of course, happens to semilogx and loglog also. It would be nice to fix all these, because it make the plot not very readable sometimes.

I write a Octave script to compute these ticks more pretty (attachment calc_axis_ticks.m). (BTW, the algorithm was adopted from my open source code).

The script can be used like this (see full version in attachment bug_demo_fix.m)

The resulting figure is attached: semilogy_demo.png. Figure 1,2,3 is original one, figure 11, 12, 13 is the fixed one.

I see a line in axes::properties::calc_ticks_and_lims, libinterp/corefcn/graphics.cc.

Not sure if this feature request can be obtained easily by tuning that tick_sep.

Eddy <count>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #46488:  calc_axis_ticks.m added by count (6KiB - text/x-objcsrc - updated algo and demo of fixing logscale ticks)
file #46489:  fix_axes_ticks.m added by count (4KiB - text/x-objcsrc - updated algo and demo of fixing logscale ticks)
file #46490:  bug_demo_fix.m added by count (329B - text/x-objcsrc - updated algo and demo of fixing logscale ticks)
file #46466:  semilogy_demo.png added by count (139KiB - image/png - demo of the fix of log ticks)
file #46467:  bug_demo_fix.m added by count (1KiB - text/x-objcsrc - demo of the fix of log ticks)
file #46468:  calc_axis_ticks.m added by count (6KiB - text/x-objcsrc - demo of the fix of log ticks)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by count (Submitted the item)
  •  

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

    Only project members can vote.

     

     

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-10 count Attached File- => Added calc_axis_ticks.m, #46488
        Attached File- => Added fix_axes_ticks.m, #46489
        Attached File- => Added bug_demo_fix.m, #46490
    2019-03-08 count Attached File- => Added semilogy_demo.png, #46466
        Attached File- => Added bug_demo_fix.m, #46467
        Attached File- => Added calc_axis_ticks.m, #46468

    Back to the top


    Powered by Savane 3.4