Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 3D scatter plot #5

Merged
merged 2 commits into from
Sep 17, 2021
Merged

Conversation

crackcomm
Copy link
Contributor

It allows us to create scatter plots in 3D. It works for matplotlib >= 3.2.0, for older versions it's required to import mpl_toolkits.mplot3d.

let fig = Fig.create () in
let ax = Fig.add_subplot_3d fig ~nrows:1 ~ncols:1 ~index:1 in
Ax3d.set_xlabel ax "max drawback";
Ax3d.set_ylabel ax "loss";
Ax3d.set_zlabel ax "cost";
Ax3d.grid ax true;
Ax3d.scatter ax ~c:Yellow values;

I created Ax3d.t because otherwise it could be possible to plot 2D values on it while generating runtime warnings.

@LaurentMazare LaurentMazare merged commit 653b2fc into LaurentMazare:master Sep 17, 2021
@LaurentMazare
Copy link
Owner

Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants