Menu

#166 Legend, UsePointShapes, and shape='none'

6.0.0
closed
lbayuk
None
5
Fixed
2013-04-03
2012-12-24
lbayuk
No

If you have a linepoints plot, set one of the shapes to 'none' to suppress the point marker for that dataset, and have a legend with SetLegendUseShapes(True), then the legend will have no marker at all for that data set, even though a line is plotted. PHPlot should probably fall back to drawing a color box in this case.

Related

Wiki: 6.0.0-NEWS

Discussion

  • lbayuk

    lbayuk - 2012-12-24

    Found this while working on [feature-requests:#50] and [feature-requests:#51] for PHPlot-6.0.0, but the problem exists in 5.8.0 (and older). It doesn't look like a quick fix. For one thing, it only needs to do this for linepoints plots, not points plots, but checking for the plot type directly is something to avoid (and not done anywhere else in PHPlot).

    Maybe it should fall back to a line marker (new in PHPlot-6.0.0), rather than a color box? Except line markers need 4x width vs point shape markers.

     

    Related

    Feature Requests: #50
    Feature Requests: #51

  • lbayuk

    lbayuk - 2013-03-19

    Idea for fixing this: when doing the legend with point shapes, override shape 'none' with another shape, such as 'line'. This puts a short horizontal line of the right color in the legend. (This avoids the issue in the previous comment that using line markers there would be better, but the line markers want to be 4x wide.) Tried it: 'line' works but isn't that visible. 'rect' is more visible, but the shape is misleading since there are no actual rectangle boxes on the plot lines.

    The comment about points vs linepoints plots is probably moot. Yes, with this fix, if you have a points plot with some shapes set to 'none', you get no plotted points for that data set - but you will get a legend line with a short horizontal line for a marker. But 'none' is documented in SetPointShapes() as only being useful for linepoints plots, so this isn't much of a concern.

     
  • lbayuk

    lbayuk - 2013-03-19
    • milestone: None --> 6.0.0
    • resolution: None --> Fixed
     
  • lbayuk

    lbayuk - 2013-03-19

    The fix described above has been committed to SVN (on the /Rel6 branch). PHPlot will use the 'line' marker instead of 'none' when drawing the legend. The fix will be in PHPlot-6.0.0.

     
  • lbayuk

    lbayuk - 2013-03-19
    • assigned_to: lbayuk
     
  • lbayuk

    lbayuk - 2013-04-03
    • status: open --> closed
     
  • lbayuk

    lbayuk - 2013-04-03

    Fixed in 6.0.0

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.