bugGNU Octave - Bugs: bug #31800, plotyy ylabels implemented...

 
 

bug #31800: plotyy ylabels implemented incorrectly for FLTK backend

Submitter:  Rik <rik5>
Submitted:  Mon 06 Dec 2010 03:23:28 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  4 - Important
Priority:  5 - Normal Item Group:  Performance
Status:  Fixed Assigned to:  logari81
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 Feb 2011 11:51:23 PM UTC, comment #14: 

Ok, I'll close this one and open another

D.

David Bateman <dbateman>
Group Member
Mon 14 Feb 2011 08:47:43 PM UTC, comment #13: 

This is the original bug report:
"The ylabels for plotyy are drawn in the color of the corresponding plot, at least for gnuplot and Matlab. This is not the case for the FLTK backend. In addition, the second y-axis ylabel is placed inside the plot box rather than outside it."

The problems mentioned here have been fixed. Please file a new bug report for any other issues.

Konstantinos Poulios <logari81>
Mon 14 Feb 2011 08:12:30 PM UTC, comment #12: 

The plots in the fltk backend still seem to have too much space to the left and below the plots, even with Kostas' outerposition/position patch.

D.

David Bateman <dbateman>
Group Member
Fri 21 Jan 2011 09:47:28 PM UTC, comment #11: 

Ok, I have pushed this one.

Regarding the positioning problem, there is now a patch, which among other, fixes this problem as well:

https://mailman.cae.wisc.edu/pipermail/octave-maintainers/2011-January/022324.html

Konstantinos Poulios <logari81>
Fri 21 Jan 2011 12:48:17 PM UTC, comment #10: 

The corrected changset has fixed the color problem.

I recommend this changeset be pushed. Before pushing I noticed the Changelog indicates the x/y/zlabel.m functions are private. Please correct that.

Ben Abbott <bpabbott>
Group Member
Fri 21 Jan 2011 09:30:43 AM UTC, comment #9: 

Last patch missed the c++ part so please consider this one instead

(file #22479)

Konstantinos Poulios <logari81>
Fri 21 Jan 2011 09:07:40 AM UTC, comment #8: 

A new try

(file #22478)

Konstantinos Poulios <logari81>
Tue 18 Jan 2011 10:36:08 PM UTC, comment #7: 

Fixing the colors issue seems indeed easy, though I would like a second opinion on the attached patch. Do you have any better suggestion instead of the ugly string concatenation that I did in _axis_label_.m ?

Concerning the positioning I have already a complete and tested solution, including your last proposal, but as said before, I do not provide a changeset at the moment because it is on top of other changes that are waiting to be tested/pushed.

(file #22450)

Konstantinos Poulios <logari81>
Tue 18 Jan 2011 09:24:42 PM UTC, comment #6: 

Point 1) proposed by Ben certain does.. The axes don't move at when the the label positions are changed, and with for example

set(gca(),"xaxislocation","top")

there is more space underneath the axis rather over it even though the text is above the axis... This is the harder part to fix.. Just moving the axis text in the fltk backend is basically probably something like

+verbatim
                  case AXE_HORZ_DIR:
                    if (x2Dtop)
                      p(1) -= hmax;
                    else
                      p(1) += hmax;
                    break;
-verbatim-

around line 1150 in gl-renderer.cc.. As for getting the colour right that's even more trivial.

D.

David Bateman <dbateman>
Group Member
Tue 18 Jan 2011 09:05:23 PM UTC, comment #5: 

<offtopic>
@David Bateman
this bug report has actually little to do with the position, outerposition, tightinset problem. Please, let us keep discussions about this issue in really relevant bug reports like https://savannah.gnu.org/bugs/?31610
btw, I am working towards a solution for this but it is a long way. The first step would be this
https://mailman.cae.wisc.edu/pipermail/octave-maintainers/2011-January/022173.html
I would appreciate any help with testing and any remarks about this patch
</offtopic>

Concerning this bug report (31800), I have a patch fixing at least the positioning of the second axis label (actually it fixes axes labels for yaxislocation=right and xaxislocation=top). Though, in order to avoid double work, I would prefer to send it for testing after I receive some feedback on
https://mailman.cae.wisc.edu/pipermail/octave-maintainers/2011-January/022173.html
so that I can push it.

Konstantinos Poulios <logari81>
Tue 18 Jan 2011 06:39:26 AM UTC, comment #4: 

The crux of the problem of getting the axis position correct in the fltk backend is that the position property has to be updated, taking into account the text extents and position of the axis label and tic marks. As gnuplot can't give the text extents back, I assume that the anyway to treat this is both backends is going to be hack.

D.

David Bateman <dbateman>
Group Member
Tue 18 Jan 2011 12:56:38 AM UTC, comment #3: 

I'd hoped to leave the gnuplot side alone. Is there a way to move the native backends forward without dragging gnuplot along?

I've cc'd Kostas since he's recently made contributions to both backends.

Ben Abbott <bpabbott>
Group Member
Tue 18 Jan 2011 12:47:16 AM UTC, comment #2: 

Ben,

I think your point 2 is relatively easy to fix in gl-render.cc. However it seems to me that the fltk backend is respecting the axis "position" property, so without horrible hacks, the axis position property needs to be updated taking into account the text extents of ticks and labels if the {x|y}axislocation is changed. The update functions for the axis properties can handle this.

This looks like a real mess to fix as it essentially  means getting the position, outerposition and activeposition properties to work correctly with the fltk backend, and then putting your activeposition code back into the gnuplot backend (checking that legends still work). Finally the syncing of the position and outerposition properties needs to be fixed, taking into account the text extents of the labels and ticks.

D.


David Bateman <dbateman>
Group Member
Sun 19 Dec 2010 10:40:10 PM UTC, comment #1: 

The same problem exists with the xaxislocation is changed from "bottom" to "top"


plot (0:1, 0:1)
xlabel ("xlabel")
ylabel ("ylabel")
set (gca, "xaxislocation", "top")
set (gca, "yaxislocation", "right")


I'm elevating the severity since the FLTK backend now allows for manual placement of the axis labels. For example, the commands below should replace the existing x/ylabels.


h1 = text (0.5, 0.5, "new xlabel");
h2 = text (0.5, 0.5, "new ylabel");
set (gca, "xlabel", h1)
set (gca, "ylabel", h2)


It looks to me like there are two problems. (1) the axis position property needs to be modified when either axis location changes. (2) the position of the text objects representing the axis labels need to be calculated correctly.

Ben Abbott <bpabbott>
Group Member
Mon 06 Dec 2010 03:23:28 AM UTC, original submission:  

The ylabels for plotyy are drawn in the color of the corresponding plot, at least for gnuplot and Matlab.  This is not the case for the FLTK backend.  In addition, the second y-axis ylabel is placed inside the plot box rather than outside it. 

See plotyy_1_1.png at http://octave.sourceforge.net/compare_plots/

Rik <rik5>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #22479:  bug-31800-color-2.changeset added by logari81 (3KiB - application/octet-stream - Fixing color issue)
file #22478:  bug-31800-color-1.changeset added by logari81 (2KiB - application/octet-stream - Fixing color issue)
file #22450:  bug-31800-color.changeset added by logari81 (3KiB - application/octet-stream - Patch fixing the color issue)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by logari81 (Posted a comment)
  • -email is unavailable- added by bpabbott
  • -email is unavailable- added by dbateman (Posted a comment)
  • -email is unavailable- added by bpabbott (Posted a comment)
  • -email is unavailable- added by rik5 (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 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-02-14 dbateman Open/ClosedOpen Closed
    2011-02-14 logari81 StatusConfirmed Fixed
    2011-02-12 logari81 Assigned toNone logari81
    2011-01-21 logari81 Attached File- Added bug-31800-color-2.changeset, #22479
    2011-01-21 logari81 Attached File- Added bug-31800-color-1.changeset, #22478
    2011-01-18 logari81 Attached File- Added bug-31800-color.changeset, #22450
    2011-01-18 bpabbott Carbon-Copy- Added -email is unavailable-
    2010-12-19 bpabbott Severity3 - Normal 4 - Important
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code