bugGNU Octave - Bugs: bug #29569, the bottom right figure of second...

 
 

bug #29569: the bottom right figure of second plotyy demo incorrect

Submitter:  David Bateman <dbateman>
Submitted:  Thu 15 Apr 2010 10:28:28 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  bpabbott
Originator Name:  David Bateman 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

Sun 25 Apr 2010 03:43:15 PM UTC, comment #20: 

Ok, I see and I'm an idiot... I was miising the final axis square and expecting UR to be the same as LL.. Forget it, this works fine

D.

David Bateman <dbateman>
Group Member
Sun 25 Apr 2010 02:01:16 PM UTC, comment #19: 

hmmm ... perhaps my understanding for what the "aspect ratio" represents is in error?

After running demo ("plotyy", 2), I just did a manual measurement of the bbox for each plot box. UL: 188x143, LL: 188x143, LR: 144x144, and UR: 188x143 pixels. Since I used the mouse, I may be off by +/- 1 pixel.

So for me the UL, LL, and UR each have the same axes position width and height. and the UR is square.

Also ...

octave:3> get (gca, "position") .* get (gcf, "position")([3,4,3,4])
ans =   319.391    46.200   187.409   143.288

This looks as I expect. Do you get the same, or am I misinterpreting something?

BTW, looking at your plot the sizes are UL,LL,UR: 214x146 and LR: 164x146. Thus, the "square" plot isn't square. Any idea why?

Regarding your UR plot, this small 3D size is a feature of gnuplot-4.2.x, which I think can be fixed, but I haven't yet attempted to try.

Ben Abbott <bpabbott>
Group Member
Sun 25 Apr 2010 05:55:15 AM UTC, comment #18: 

Your image is the same as mine essentially.. The top left plot should have the same aspect ratio as the bottom left, but doesn't

D.

David Bateman <dbateman>
Group Member
Sat 24 Apr 2010 11:42:02 PM UTC, comment #17: 

Ok, I can see your result isn't square.

I've attached what I see as well.




Ben Abbott <bpabbott>
Group Member
Sat 24 Apr 2010 10:31:04 PM UTC, comment #16: 

I used both the x11 and the wxt terminals with gnuplot 4.4.0 and 4.3.6 with the same result. I attach here a screenshot with the wxt terminal demonstrating the issue

D.



David Bateman <dbateman>
Group Member
Sat 24 Apr 2010 08:47:24 PM UTC, comment #15: 

David,

For x11, I get the correct aspect ratio with both 4.2.5 and 4.4 (pre-release).

What gnuplot terminal are you using?

And is the dpi of your screen the same horizontally and vertically?

Ben

Ben Abbott <bpabbott>
Group Member
Sat 24 Apr 2010 06:56:01 PM UTC, comment #14: 

Ok it appears to be fixed with gnuplot 4.2.6 and 4.4.0.. However the aspect ratio of the two plotyy figures in the second plotyy demo is still incorrect, but good enough.. I consider this bug closed, so I'm closing it ;-)

D.

David Bateman <dbateman>
Group Member
Mon 19 Apr 2010 11:29:01 AM UTC, comment #13: 

I noticed some code regarding the colorbox aspect ratio was present, but no longer functional after these changes. So I've removed them.

A new changeset has been uploaded.

There remain some problems with regards to the colorbar, which I'll address when fixing bug at --> https://savannah.gnu.org/bugs/?29568


(file #20283)

Ben Abbott <bpabbott>
Group Member
Sun 18 Apr 2010 03:21:21 AM UTC, comment #12: 

Updated changeset which addresses the colorbar as well.

(file #20265)

Ben Abbott <bpabbott>
Group Member
Sun 18 Apr 2010 01:16:46 AM UTC, comment #11: 

The changeset I just attached causes problems with the colorbar demos. Those demos didn't all work correctly before. Thus, I'm not yet sure where the colorbar problem lies.

Ben Abbott <bpabbott>
Group Member
Sun 18 Apr 2010 01:13:13 AM UTC, comment #10: 

Upon re-examination, there is a problem in the plot stream. Octave developer sources incorrectly specifies the aspect ratio of the axes box in the gnuplot plot-stream. I've attached a changeset that fixes the problem for me. I've tested it with gnuplot 4.2.6 and using the developers sources, pre-4.4.

(file #20263)

Ben Abbott <bpabbott>
Group Member
Sat 17 Apr 2010 04:07:43 PM UTC, comment #9: 

I've installed gnuplot 4.2.6 and see the same result as you. I looked that the plot stream, but don't see anything unusual.

What is unusual is that the three examples below give very different results.

figure(1)
clf
x = 0:0.1:2*pi;
y1 = sin (x);
y2 = cos (x);
ax = plotyy (x, y1, x, y2);
xlabel ("X");
ylabel (ax(1), "Axis 1");
ylabel (ax(2), "Axis 2");
axis (ax(2), "square")

figure(2)
clf
x = 0:0.1:2*pi;
y1 = sin (x);
y2 = exp(x - 1);
ax = plotyy (x, y1, x, y2)
xlabel ("X");
ylabel (ax(1), "Axis 1");
ylabel (ax(2), "Axis 2");
axis (ax(2), "square")

figure(3)
clf
x = 0:0.1:2*pi;
y1 = sin (x);
y2 = (x - 1);
ax = plotyy (x, y1, x, y2)
xlabel ("X");
ylabel (ax(1), "Axis 1");
ylabel (ax(2), "Axis 2");
axis (ax(2), "square")

I have some errands to run. Later I'll try to create some simple gnuplot commands to determine if the problem is with gnuplot or octave.

Ben Abbott <bpabbott>
Group Member
Sat 17 Apr 2010 12:54:23 PM UTC, comment #8: 

The version I used is the version from debian testing.

G N U P L O T
Version 4.2 patchlevel 6
last modified Sep 2009
System: Linux 2.6.30-1-686

Installing version 4.4 and yes it works correctly with both the x11 and wxt terminals. However as gnuplot 4.4 was just released, I'd say we have to enure that older versions of gnuplot still give reasonable result.. Do you know of a work around?

D.

David Bateman <dbateman>
Group Member
Fri 16 Apr 2010 10:50:39 PM UTC, comment #7: 

David, I'm suspicious we may be running different versions of gnuplot.  I'm running a version I compiled from the developers sources a few months ago. What version are you running?

Also, what do you get when you do the following? Is the mode of each axes set to "manual".

octave:10> demo ("plotyy", 1); axis square; get (findall (gcf, "type", "axes"), "plotboxaspectratiomode")

plotyy example 1:
 clf
 x = 0:0.1:2*pi;
 y1 = sin (x);
 y2 = exp (x - 1);
 ax = plotyy (x, y1, x - 1, y2, @plot, @semilogy);
 xlabel ("X");
 ylabel (ax(1), "Axis 1");
 ylabel (ax(2), "Axis 2");

ans =

{
  [1,1] = manual
  [2,1] = manual
}

I've attached the result I see.

Once you've reported the version of gnuplot you're using, I'll install and test that one.

Ben


Ben Abbott <bpabbott>
Group Member
Fri 16 Apr 2010 08:46:39 PM UTC, comment #6: 

I get the attached even after the patch with both the x11 and wxt terminals

D.



David Bateman <dbateman>
Group Member
Fri 16 Apr 2010 07:03:05 PM UTC, comment #5: 

David, I just pulled and tested from a directory with no m-files present. This change works for me. I've verified the behavior for x11, and aqua. Using pdf the axes are the same size and position, but have the wrong width (no idea why yet).


Ben Abbott <bpabbott>
Group Member
Fri 16 Apr 2010 04:06:47 PM UTC, comment #4: 

It doesn't seem to work for me however

D.

David Bateman <dbateman>
Group Member
Fri 16 Apr 2010 04:02:11 PM UTC, comment #3: 

I pushed it for you.

D.

David Bateman <dbateman>
Group Member
Fri 16 Apr 2010 02:12:59 PM UTC, comment #2: 

My first impression was incorrect. The problem what that the listener for the plotboxaspectratio did not catch the special case where the value is set to the default. In this case the mode is changed to manual, but since the property value does not change, no callback is initiated.

To fix it, I've added a listener to the plotboxaspecratiomode.

A changeset is attached. I'll push this change later today.

(file #20237)

Ben Abbott <bpabbott>
Group Member
Fri 16 Apr 2010 11:38:58 AM UTC, comment #1: 

I took a quick look. A fix looks straight forward to fix. I'll start by writing a private script that determines the displayed axes position when the plotboxaspectratio indicates something different than the "position" property implies (I'm assuming such a feature isn't yet available from the native backend).

Ben Abbott <bpabbott>
Group Member
Thu 15 Apr 2010 10:28:28 PM UTC, original submission:  

The bottom right hand figure of the second plotyy has a compressed y axis. Try

demo("plotyy", 2)

As I know you've worked on the sizing of the figures I used the "assigned to" tab on savannah to give the bug to you Ben ;-)

D.

David Bateman <dbateman>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #20316:  Screenshot-1.png added by dbateman (65KiB - image/png)
file #20283:  changeset.patch added by bpabbott (6KiB - application/octet-stream - changeset.patch with nonfunctional code removed)
file #20265:  changeset.patch added by bpabbott (5KiB - application/octet-stream - Requires up to date sources)
file #20263:  changeset.patch added by bpabbott (3KiB - application/octet-stream - Before testing this changeset, please verify your sources are curent.)
file #20247:  Figure 1.png added by bpabbott (44KiB - image/png - Ben's plotyy result)
file #20246:  Screenshot.png added by dbateman (15KiB - image/png)
file #20237:  changeset.patch added by bpabbott (1KiB - application/octet-stream - add listener to the axes plotboxaspectratiomode)

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2010-04-24 bpabbott Attached File- Added Screen shot 2010-04-24 at 7.39.44 PM.png, #20318
    2010-04-24 dbateman Attached File- Added Screenshot-1.png, #20316
    2010-04-24 dbateman StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2010-04-24 bpabbott StatusNone Patch Submitted
    2010-04-19 bpabbott Attached File- Added changeset.patch, #20283
    2010-04-18 bpabbott Attached File- Added changeset.patch, #20265
    2010-04-18 bpabbott Attached File- Added changeset.patch, #20263
    2010-04-16 bpabbott Attached File- Added Figure 1.png, #20247
    2010-04-16 dbateman Attached File- Added Screenshot.png, #20246
    2010-04-16 bpabbott Attached File- Added changeset.patch, #20237

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code