Replies: 4 comments 5 replies
-
I tried adding the lines in the same set
But it doesn't work the same as adding them explicitly with plot(x1, y1, x2, y2, x3, y3, ...). This is the result: |
Beta Was this translation helpful? Give feedback.
-
The error is telling you the function expects |
Beta Was this translation helpful? Give feedback.
-
I want to be able to plot a set of lines with x and y values from sets/vectors. |
Beta Was this translation helpful? Give feedback.
-
Like in the above sample using the set, how can I set explicit x values? |
Beta Was this translation helpful? Give feedback.
-
I am trying to create a plot with multiple lines. I specifically want to draw a path, but this can be simplified to drawing multiple lines. I have tried two different ways from the documentation:
https://alandefreitas.github.io/matplotplusplus/plot-types/line-plots/line-plot/
I am just trying to draw all lines in the path. If I use a set, it only lets me specify one set for X, and I can't seem to add a second set for the Y positions. Can someone clarify the correct way to do this?
std::set<std::vector> linePointsX;
std::set<std::vector> linePointsY;
...
matplot::plot(linePointsX, linePointsY);
This gives me the following error:
Error C2664 'matplot::line_handle matplot::axes_type::plot(const std::vector<double,std::allocator> &,const std::vector<double,std::allocator> &,std::string_view)': cannot convert argument 1 from 'std::set<std::vector<double,std::allocator>,std::less<std::vector<double,std::allocator>>,std::allocatormatplot::vector_1d>' to 'const std::vector<double,std::allocator> &'
In other examples, it calls plot multiple times, and they overlap in the same plot, but when I try to call plot multiple times, it refreshes to only show the single line for each plot, even though I only call show once.
Beta Was this translation helpful? Give feedback.
All reactions