Open antoinedray opened 3 years ago
Remove gca method as it conflicts with simple surface plotting.
New technique found instead:
Adds plot_surface
function overloading:
template <typename Numeric>
void plot_surface(long figure,
const std::vector<::std::vector<Numeric>> &x,
const std::vector<::std::vector<Numeric>> &y,
const std::vector<::std::vector<Numeric>> &z,
const std::map<std::string, std::string> &keywords = std::map<std::string, std::string>())
By passing the figure id as parameter, it is now possible to bring multiple surfaces in the same figure:
long id = plt::figure();
plt::plot_surface(id, x1, y1, z1, {{"cmap", "Blues"}});
plt::plot_surface(id, x2, y2, z2, {{"cmap", "Reds"}});
plt::show();
Why did I use the second drawing method, instead of drawing the two surfaces in the same display, I just showed the first of them.
Added:
Adds bindings to the figure's gca method (matplotlib.figure.Figure.gca):
This allows display of multiple surfaces on the same figure.
See example below: