Skip to content

Commit fd05580

Browse files
committed
editing...
1 parent 5d7fde7 commit fd05580

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

examples/mesh.ml

+22-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,25 @@ let _ =
4949
Plot.(mesh ~h ~spec:[ Azimuth 115.; ZLine X; NoMagColor; RGB (61,129,255) ] x y z);
5050
Plot.subplot h 1 2;
5151
Plot.(mesh ~h ~spec:[ Azimuth 115.; ZLine Y; NoMagColor; RGB (130,255,40) ] x y z);
52-
Plot.output h
52+
Plot.output h
53+
54+
55+
let _ =
56+
let x, y = Mat.meshgrid (-3.) 3. (-3.) 3. 100 100 in
57+
let z = Mat.(
58+
3. $* ((1. $- x) **$ 2.) * exp (neg (x **$ 2.) - ((y +$ 1.) **$ 2.)) -
59+
(10. $* (x /$ 5. - (x **$ 3.) - (y **$ 5.)) * (exp (neg (x **$ 2.) - (y **$ 2.)))) -
60+
((1./.3.) $* exp (neg ((x +$ 1.) **$ 2.) - (y **$ 2.)))
61+
)
62+
in
63+
64+
let h = Plot.create ~m:2 ~n:2 "plot_017.png" in
65+
Plot.subplot h 0 0;
66+
Plot.(mesh ~h ~spec:[ Contour ] x y z);
67+
Plot.subplot h 0 1;
68+
Plot.heatmap ~h x y z;
69+
Plot.subplot h 1 0;
70+
Plot.mesh ~h x y z;
71+
Plot.subplot h 1 1;
72+
Plot.contour ~h x y z;
73+
Plot.output h

0 commit comments

Comments
 (0)