Skip to content

Graphs data from a file and visualizes equations

Notifications You must be signed in to change notification settings

KrishayB/DataGrapher

Repository files navigation

DataGrapher

About:

This program helps to visualize data by graphing a set of x and y values provided in a .txt file. It automatically scales the points to fit within a certain grid size. It can also be used to visualize an equation, but the axes will most likely be innacurate.1 Comments are added if you would like to understand the code or make changes.

Running the program:

  1. Clone the repository, download the code, or copy/paste it into a .java file. Make sure there is at least one .txt file with correctly formatted data.
  2. Run the Graphing.java file.

Example

Other notes:

This program only graphs positive numbers.

Footnotes

  1. Since you have to enter the x and y values in a .txt file to graph an equation, it will be hard to calculate those points yourself and enter them in manually. For this, the GetDataPoints.java file exists.

    The field variable LENGTH should be set to the number of data points needed. Right now, it is set to 100 data points.

    The first for-loop will print the x-coordinates. If you want different x-coordinates, you can change it.

    The equation can be changed in the first method. The current equation is 200cos(x) + 200.