![]() |
XLPack for Matplotlib Experimental Version 0.1
例題集
|
三角格子の擬似カラープロットを行う.
Sub Test_Tripcolor()
Const N = 256
Dim X(N - 1) As Double, Y(N - 1) As Double, Z(N - 1) As Double
Dim I As Integer
Dim Fig As Figure, Ax As Axs
'-- Make data
For I = 0 To N - 1
X(I) = -3 + 6 * Rnd()
Y(I) = -3 + 6 * Rnd()
Z(I) = (1 - X(I) / 2 + X(I) ^ 5 + Y(I) ^ 3) * Exp(-X(I) ^ 2 - Y(I) ^ 2)
Next
'-- Plot
Set Fig = Plt.Figure()
Set Ax = Fig.Gca()
Call Ax.Plot(N, X(), Y(), "o", "markersize=2, color='grey'")
Call Ax.Tripcolor(N, X(), Y(), Z())
Call Ax.Set_xlim(-3, 3)
Call Ax.Set_ylim(-3, 3)
Call Plt.Show
End Sub