bugGNU Octave - Bugs: bug #41777, axes labels returned by get() are...

 
 

bug #41777: axes labels returned by get() are a subset of shown with log plots

Submitter:  Fabio <efferre79>
Submitted:  Wed 05 Mar 2014 11:53:53 AM 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:  * 3.8.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 27 Apr 2018 06:33:00 PM UTC, comment #13: 

With Octave 4.4, 10 ticks are shown and 10 ticks are returned by the 'xtick' and 'xticklabel' property, with both gnuplot and qt toolkits. Closing as fixed sometime in the past 4 years.

Mike Miller <mtmiller>
Group Member
Sat 08 Mar 2014 04:32:20 PM UTC, comment #12: 

I opened a ticket for gnuplot:

https://sourceforge.net/p/gnuplot/bugs/1347/

Let's see what they think about.

Fabio <efferre79>
Sat 08 Mar 2014 04:16:45 PM UTC, comment #11: 

So do you agree this is starting to look like a gnuplot bug of some kind? I think Octave is doing the right thing since we are able to take the output it is feeding gnuplot and get good results on some gnuplots, but not others. I'd recommend you take this example to the gnuplot devs and see what they come up with.

Mike Miller <mtmiller>
Group Member
Sat 08 Mar 2014 01:59:39 PM UTC, comment #10: 

no sorry, I got the minor ticks only with fltk. So on this 64 bit system I get the same result as yours (6 ticks and labels, no minor ticks). I'd expect the minor ticks because the proper gnuplot command is present. So there is something weird in gnuplot

Fabio <efferre79>
Sat 08 Mar 2014 01:41:51 PM UTC, comment #9: 

I have tested on another system, always Gentoo but 64 bits instead of 32. In this case I get the proper behaviour, i.e. 6 labels and major ticks and also the minor ticks. The debug.gp I get in this second case is identical to the one already attached here.

Fabio <efferre79>
Fri 07 Mar 2014 07:00:44 PM UTC, comment #8: 

Yes, if I pipe the file in gnuplot I still get my usual plot with minor ticks and more than 6 ticks.

I use Gentoo so gnuplot is compiled from source, I don't see any special patch applied to it.

Fabio <efferre79>
Fri 07 Mar 2014 02:59:38 PM UTC, comment #7: 

When I pipe your debug.gp file into my gnuplot, I get the same plot I've been seeing consistently, no minor ticks, 6 x-axis labels. Do you get your same results if you pipe debug.gp into gnuplot?


gnuplot -persist < debug.gp


I also get virtually the same debug.gp as you, only the window position is different, probably because of the size of my display.

I didn't ask where you got your gnuplot from, from repositories or self-compiled, what distro are you working on, etc, if that makes a difference. I'm using gnuplot from the Debian unstable repositories (now version 4.6.5, still the same behavior for me).

Mike Miller <mtmiller>
Group Member
Fri 07 Mar 2014 09:07:51 AM UTC, comment #6: 

If I run the command line you posted I get the result already shown with minor ticks and much more axis labels. I don't have custom settings for gnuplot, no ~/.Xdefaults and ~/.Xresources files.

I have found the code generating the gnuplot commands which is located in _go_draw_axes_.m. If you write a debug patch I can test it. In the meantime I have attached the list of gnuplot directives I get for the plot obtained with the command


$ octave --norc --eval 'graphics_toolkit gnuplot; x=1:10; loglog(10.^x, 10.^x); drawnow ("x11", "/dev/null", false, "debug.gp"); '


Fabio <efferre79>
Fri 07 Mar 2014 04:39:48 AM UTC, comment #5: 

Yeah, I notice that as well. Are you sure the script you've given is all you are running from a clean Octave start? Does it make a difference if you run octave with the --norc option? Do you have any gnuplot preferences set in a ~/.Xdefaults or ~/.Xresources file?

When I run


$ octave --norc --persist --eval "graphics_toolkit gnuplot; x=1:10; loglog(10.^x, 10.^x);"


I get the plot I attached before, with 6 axis labels and no minor tick marks.

Mike Miller <mtmiller>
Group Member
Thu 06 Mar 2014 06:07:37 PM UTC, comment #4: 

I retested with gnuplot 4.6.4, x11 terminal and octave-3.8.1-rc4. The problem doesn't disappear. I noticed that in your plot there are no minor ticks while on mine they are present.

Fabio <efferre79>
Thu 06 Mar 2014 01:48:39 PM UTC, comment #3: 

That is definitely not what I get with gnuplot running your example. Here's my counterexample, the axis labels and ticks match what I see on-screen. Gnuplot 4.6.4, x11 terminal.


Mike Miller <mtmiller>
Group Member
Thu 06 Mar 2014 11:03:36 AM UTC, comment #2: 

I have attached a snapshot of the result I get with gnuplot. As you can see the number of ticks/labels is greater than the values returned by the two get() calls. I expect to get the same graphical result of fltk or Matlab

I have attached also the fltk plot which is the expected result.

I'm using gnuplot 4.6.3, the x-axis range is correct.

Fabio <efferre79>
Thu 06 Mar 2014 06:01:03 AM UTC, comment #1: 

Thanks for your bug report. I'm not sure I understand what you are describing in this report. Can you explain what you expected to happen versus what actually happens?

When I plot the loglog example you provide, I get exactly 6 x-axis ticks and labels using either gnuplot or fltk. Is your gnuplot showing a different x-axis range than from 10^0 to 10^10? What version of gnuplot are you using?

Mike Miller <mtmiller>
Group Member
Wed 05 Mar 2014 11:53:53 AM UTC, original submission:  

x=1:10;
loglog(10.^x,10.^x)

get(gca, 'XTick')
ans =

   1.0000e+00   1.0000e+02   1.0000e+04   1.0000e+06   1.0000e+08   1.0000e+10

get(gca, 'XTicklabel')
ans =
{
  [1,1] = 1e+00
  [1,2] = 1e+02
  [1,3] = 1e+04
  [1,4] = 1e+06
  [1,5] = 1e+08
  [1,6] = 1e+10
}

As you can see the returned labels are a subset of those visible in the plot. Matlab shows only the values returned by get(). This problems doesn't exist with linear plots or using fltk so the log plot with gnuplot should only show the 6 labels above

Fabio <efferre79>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #30811:  debug.gp added by efferre79 (3KiB - application/x-gnuplot)
file #30799:  nobug-41777.png added by mtmiller (19KiB - image/png)
file #30795:  out_fltk.png added by efferre79 (23KiB - image/png)
file #30794:  out.png added by efferre79 (24KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2018-04-27 mtmiller StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2014-03-07 efferre79 Attached File- Added debug.gp, #30811
    2014-03-06 mtmiller Attached File- Added nobug-41777.png, #30799
    2014-03-06 efferre79 Attached File- Added out_fltk.png, #30795
    2014-03-06 efferre79 Attached File- Added out.png, #30794
    2014-03-06 mtmiller StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code