Horizontal grid does not align with graph

Bug #321255 reported by onox
4
Affects Status Importance Assigned to Milestone
Cairo Plot
Fix Committed
Medium
Rodrigo Moreira Araújo

Bug Description

When I try to draw a dot line plot where I give the h_labels parameter of the dot_line_plot() function a list, then cairo plot does not align the graph with the grid.

For example:

data = [-4, -2, 0, 1, 3, 2, 5, 7, 8, 8, 3, 4, 5, 5, 8, 2, 1, 3, 4, 5, 0]
h_labels = [ "0s", "4s", "8s", "12s", "16s", "20s", "24s", "28s", "32s", "36s", "40s" ]
v_labels = [ "-5.5", "-4.0", "-2.5", "-1.0", "0.5", "2.0", "3.5", "5.0", "6.5", "8.0", "9.5" ]
v_bounds = (-5.5, 9.5)
CairoPlot.dot_line_plot("dot_line_2_dictionary_labels", data, 400, 300, h_labels=h_labels, v_labels=v_labels, axis=True, grid=True, v_bounds=v_bounds)

data has 21 elements, h_lables has 11 elements, and v_labels has 11 elements. This means I should get 10 closed boxes vertically, 10 closed boxes horizontally, and 2 values per box (horizontally). However, cairo plot draws 10 closed boxes horizontally _plus_ 1 open box.
When you look at the attached .svg image, you see that the graph ends somewhere in this open box (of the grid). While the values of the graph correspond with the vertical labels perfectly, it does not with the horizontal labels. For example, 8s should align with the value 3, and 16s should align with value 8.

It would be nice that when I provide a *_labels with n+1 elements, that cairo plot draws n closed boxes and zero open boxes.

Using revision 20 of trunk.

Revision history for this message
onox (onox) wrote :
description: updated
description: updated
onox (onox)
description: updated
Revision history for this message
Rodrigo Moreira Araújo (alf-rodrigo) wrote :

Indeed this happens.
I'll be working on a fix as soon as possible.

Changed in cairoplot:
assignee: nobody → alf-rodrigo
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Rodrigo Moreira Araújo (alf-rodrigo) wrote :

Bug fixed. Tested with your example and worked correctly now.

Changed in cairoplot:
status: Confirmed → Fix Committed
Revision history for this message
onox (onox) wrote :

Thank you :D It works.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.