comparison src/graphics.cc @ 13910:2af665333b86

title positioning taking xaxislocation into account (bug #33418) * graphics.cc (axes::properties::update_title_position): add x label tick height to title position for xaxislocation set to "top"
author Konstantinos Poulios <logari81@googlemail.com>
date Tue, 22 Nov 2011 18:20:41 +0100
parents 32a77debff75
children 3b654a0753b1
comparison
equal deleted inserted replaced
13909:c694c4ced5f7 13910:2af665333b86
5111 { 5111 {
5112 graphics_xform xform = get_transform (); 5112 graphics_xform xform = get_transform ();
5113 5113
5114 // FIXME: bbox should be stored in axes::properties 5114 // FIXME: bbox should be stored in axes::properties
5115 Matrix bbox = get_extent (false); 5115 Matrix bbox = get_extent (false);
5116 ColumnVector p = xform.untransform (bbox(0)+bbox(2)/2, (bbox(1)-10), 5116
5117 (x_zlim(0)+x_zlim(1))/2, true); 5117 ColumnVector p =
5118 graphics_xform::xform_vector (bbox(0)+bbox(2)/2,
5119 bbox(1)-10,
5120 (x_zlim(0)+x_zlim(1))/2);
5121
5122 if (x2Dtop)
5123 {
5124 Matrix ext (1, 2, 0.0);
5125 ext = get_ticklabel_extents (get_xtick ().matrix_value (),
5126 get_xticklabel ().all_strings (),
5127 get_xlim ().matrix_value ());
5128 p(1) -= ext(1);
5129 }
5130
5131 p = xform.untransform (p(0), p(1), p(2), true);
5118 5132
5119 title_props.set_position (p.extract_n(0, 3).transpose ()); 5133 title_props.set_position (p.extract_n(0, 3).transpose ());
5120 title_props.set_positionmode ("auto"); 5134 title_props.set_positionmode ("auto");
5121 } 5135 }
5122 } 5136 }