/// <summary> /// サイズを設定する. /// </summary> public static void SetSize(this Wgnuplot plot, Size value) { String command = ""; switch (value.Type) { case SizeType.Square: command = "set size square"; break; case SizeType.RatioAxis: command = "set size ratio " + value.RatioValue; break; case SizeType.RatioUnit: command = "set size ratio -" + value.RatioValue; break; } plot.Send(command); }
static void Run() { Type tester = typeof(Tester); MethodInfo[] methods = tester.GetMethods(BindingFlags.Static | BindingFlags.NonPublic); foreach (MethodInfo method in methods) { if (!method.Name.StartsWith("Test")) { continue; } using (Wgnuplot plot = new Wgnuplot(@".\gnuplot\bin\pgnuplot.exe")) { System.Console.WriteLine("Method.Name = " + method.Name); System.Console.Write("exit? [y/n]: "); method.Invoke(null, new object[] { plot }); ConsoleKeyInfo key = System.Console.ReadKey(); System.Console.WriteLine(); if (key.Key == ConsoleKey.Y) { break; } } } }
/// <summary> /// x2 軸の目盛を設定する. /// </summary> public static void SetX2Tics(this Wgnuplot plot, Tics value) { plot.Send(value != null ? "set x2tics " + value : "unset x2tics"); }
public static void Test(this Wgnuplot plot) { Console.WriteLine("test"); }
/// <summary> /// y2 軸の範囲を設定する. /// </summary> public static void SetY2Range(this Wgnuplot plot, Range value) { String command = String.Format("set y2range [{0}:{1}]", value.From, value.To); plot.Send(command); }
/// <summary> /// y 軸のラベルを設定する. /// </summary> public static void SetYLabel(this Wgnuplot plot, Label value) { plot.Send(value != null ? "set ylabel " + value : "unset ylabel"); }
public static void UnsetSize(this Wgnuplot plot) { plot.Send("unset size"); }
public static void UnsetArrow(this Wgnuplot plot) { }
/// <summary> /// 枠線を設定する. /// </summary> public static void SetBorder(this Wgnuplot plot, Border value) { plot.Send("set border " + (int)value); }
/// <summary> /// y 軸を log スケールに設定する. /// <remarks> /// <c>true</c> の場合は log スケールに,<c>false</c> の場合は log スケール設定を解除する. /// </remarks> /// </summary> public static void SetLogScaleY(this Wgnuplot plot, bool value) { plot.Send((value ? "" : "un") + "set logscale y"); }
/// <summary> /// y 軸目盛の分割数を設定する. /// <para>例えば 2 を設定した場合,目盛が 2 分割されるため,目盛の間に補助目盛が 1 つ表示される.</para> /// </summary> public static void SetMYTics(this Wgnuplot plot, int value) { plot.Send("set mytics " + value); }
public static void SetArrow(this Wgnuplot plot, Arrow arrow) { }
/// <summary> /// y 軸のミラー設定を行う. /// <para><c>false</c> を設定すると,左右軸の目盛が一致しなくなる.</para> /// </summary> public static void SetYTicsMirror(this Wgnuplot plot, bool value) { plot.Send("set ytics " + (value ? "" : "no") + "mirror"); }
static void Test01(Wgnuplot plot) { plot.Send("splot x**2 + y**2"); }