0

I'm trying to plot a 3d surface using jmathplot. I currently have a java file that I run by using

javac Plot.java
java Plot

Running the program returns 3 arrays corresponding to the x, y, and, z values of the graph. Where x[0], y[0], z[0] are the coordinates of the first point of the graph.

How do I use jmathplot to graph this 3d surface?

With python I would usually use

pip install jmathplot

and then I can simply use

import jmathplot as jmp

at the start of my code so that I can use any of the jmathplot functions.

I don't understand how this process works with Java. I'm not using eclipse because the whole program is really only a few files. I've read that you can use Maven and edit the pom.xml file but so far that hasn't been working for me either.

assembler
  • 3,098
  • 12
  • 43
  • 84
IVRafa
  • 45
  • 1
  • 7
  • If you use Eclipse it will be easy to debug and fix issues. – वरुण Dec 07 '17 at 14:44
  • Without IDE you won't be able to see potential bugs in the `pom.xml` file. I strongly recommend using i.e. Eclipse. You can easily find tutorials on how to setup Maven project and download dependencies. – Michael Dz Dec 07 '17 at 14:49

1 Answers1

0

First of all, you do not have to use an IDE. Although if you would then you will develop your project a lot easier. Writing a java project (no matter how big it is) without an IDE is like trying to make multiple calculations on paper. You have to use an IDE in order to make the development process far more easier and save a lot of time.

Secondly, if you want to include the jmathplot library to your project you have to include it as a maven dependency inside your pom file like below:

<dependencies>
...
    <dependency>
      <groupId>com.github.yannrichet</groupId>
      <artifactId>JMathPlot</artifactId>
      <version>1.0.1</version>
    </dependency>
...
</dependencies

Then you have to build your project with mvn install goal-phase in order to download and package the library into your local repository so to use it as a dependency in your project. You can read here more information about maven build phases and goals.

Finally, just import the library in the class where you want to use it like below:

import org.math.plot.*;