WIN_IO

A simple set of packages for graphical input and output


Universidad de Cantabria, SPAIN

Author: Michael Gonzalez  mgh@unican.es

Win_IO is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.
 

1. Plot_Window Example


File : test_plot_window.adb


with Plot_Windows; use Plot_Windows;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Numerics.Elementary_Functions;
use Ada.Numerics.Elementary_Functions;

procedure Test_Plot_Window is
   Plot : Plot_Window_Type:=Plot_Window("Test Plot Window","Degrees",
                                        "Value");
   X : Float;
begin
   -- Sin Graph
   Set_Color(Plot,Blue);
   Set_Symbol(Plot,Circle);
   Set_Lines(Plot,True);
   Set_Graph_Title(Plot,"Sin(x)");
   X:=0.0;
   for I in 1..100 loop
      Add_Point(Plot,X,Sin(X,360.0));
      X:=X+10.0;
   end loop;

   -- Cos Graph
   New_Graph(Plot);
   Set_Color(Plot,Red);
   Set_Symbol(Plot,Up_Triangle);
   Set_Lines(Plot,False);
   Set_Graph_Title(Plot,"Cos(x)");
   X:=0.0;
   for I in 1..100 loop
      Add_Point(Plot,X,Cos(X,360.0));
      X:=X+10.0;
   end loop;

   -- Paint the plot
   Wait(Plot);
   Put_Line("Test Completed");
end Test_Plot_Window;