cvplot icon indicating copy to clipboard operation
cvplot copied to clipboard

set with vector<pair<float, cvplot::Point2>> does not work as expected.

Open copark86 opened this issue 5 years ago • 1 comments

It seems like set function does not handle cvplot::Circle data properly.

    std::vector<std::pair<float, cvplot::Point2>> pole({
      std::pair<float, cvplot::Point2>(5.0f,{X(0),Y(0)})    // Expected usage of set with vector<pair<float, Point2>>
      std::pair<float, cvplot::Point2>(X(0),{Y(0),5.0f})    // The code actually works.  
    });
    figure.series("South Pole")    
    .type(cvplot::Circle)
    .color(cvplot::Red)
    .set( pole);    
    figure.show(false); 

copark86 avatar Sep 21 '19 17:09 copark86

I agree, it is a little confusing. FWIW, the idea is plotting y and radius against x, therefore grouping y and radius in the second argument. I am open to a rewrite of some of this logic. The balance between expressiveness and ease of use depends on the kinds of plots (dimensionality of data) cvplot should be supporting.

leovandriel avatar Jun 04 '22 04:06 leovandriel