yannrichet / jmathplot Goto Github PK
View Code? Open in Web Editor NEWJava interactive 2D and 3D plots (no OpenGL)
License: BSD 2-Clause "Simplified" License
Java interactive 2D and 3D plots (no OpenGL)
License: BSD 2-Clause "Simplified" License
I have a problem , i working with intellijIdea and get below error :
Exception in thread "main" java.lang.NoClassDefFoundError: org/math/io/StringPrintable
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.math.plot.canvas.PlotCanvas.(PlotCanvas.java:491)
at org.math.plot.canvas.Plot2DCanvas.(Plot2DCanvas.java:25)
at org.math.plot.Plot2DPanel.(Plot2DPanel.java:31)
at FFT.main(FFT.java:110)
Caused by: java.lang.ClassNotFoundException: org.math.io.StringPrintable
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Could you please add a LICENSE file indicating the license under which the source code of the project is made available?
-Does JMathPlot have a GPL style license making the library free for commercial
use and inclusion
(but not reselling)?
-Where are the Javadoc files for JMathPlot?
-May JMathPlot produce graphs, charts, plots which are fully 3D rotatable?
-May JMathPlot produce one object for the final chart, which includes all data
and metadata
within the plot, as a fully rotatable JAVA3D Object? How is this acheived?
-May JMathPlot produce 2D or 3D graphs as jpeg, bmp, gif, png file types
automatically?
Original issue reported on code.google.com by [email protected]
on 12 Jun 2012 at 3:56
What steps will reproduce the problem?
1. Try using this library from project that uses Apache Maven 2+ as build tool
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Here is guide on using Sonatype repository hosting for open source projects:
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage
+Guide
Original issue reported on code.google.com by [email protected]
on 30 Apr 2012 at 11:05
I want the numbers on axes to be more visible.
Original issue reported on code.google.com by [email protected]
on 5 Mar 2015 at 9:31
What steps will reproduce the problem?
1. Run the histogram example from the wiki
2. Notice that it is consuming an entire CPU core...
What is the expected output? What do you see instead?
It shouldn't be constantly redrawing
What version of the product are you using? On what operating system?
Latest code from SVN
Please provide any additional information below.
It looks like the problem is that HistogramPlot2D.plot() calls:
draw.canvas.includeInBounds(bottomLeft[0]);
draw.canvas.includeInBounds(topRight[XY.length - 1]);
..which in turn call repaint() and force a redraw of the chart, hence looping
infinitely.
Skim-reading the code, I guess the same applies to ClodPlot2D and 3D too.
Original issue reported on code.google.com by [email protected]
on 8 Aug 2010 at 10:21
I want to combine the scatter plot and the broken line plot into one, and the axes are in the shape of a cross. How can I achieve this?
What steps will reproduce the problem?
- Plot2DCanvas:
When providing two arrays, one for X and for Y, each of length 2, to the
Plot2DCanvas method "addScatterPlot(String, Color, double[], double[])", then
the columns don't get merged to create an array of x-y pairs, but merely
returned (see method "convertXY" in org.math.plot.canvas.Plot2DCanvas class).
This means that the two arrays, listing x and y separately, get treated
incorrectly as two x-y pairs instead.
- Plot3dCanvas:
When providing three arrays, one for X, one for Y and one for Z, each of length
3, to the Plot3DCanvas method "addScatterPlot(String, Color, double[],
double[], double[])", then the columns don't get merged to create an array of
x-y-z triplets, but merely returned (see method "convertXYZ" in
org.math.plot.canvas.Plot3DCanvas class). This means that the three arrays,
listing x, y and z separately, get treated incorrectly as three x-y-z pairs
instead.
What is the expected output? What do you see instead?
I've attached two source files that solely depend on the jmathplot library.
Both of them will pop up two JFrames, one with the correct display and one with
the incorrect display.
In the 2D case, it is immediately apparent, since the incorrect one displays
the same min/max for the X and Y axes (10-50) instead of X:10-12 and Y:45-47.
And in the 3D case, it is easiest to turn them in such a way, that one looks
onto the X-Y plane (= bird's view). The correct display has the axis ranges
X:10-12 and Y:45-47, the incorrect one X:10-100 and Y:10-200.
What version of the product are you using? On what operating system?
Latest version from subversion/trunk. Linux (Centos 5.5 64-bit). Java 1.6.0_20
64-bit.
Fix:
I've attached a patch file (plot_canvas.patch), generated from the current
trunk in the subversion repository, that fixes this problem.
Original issue reported on code.google.com by fracpete
on 28 Jun 2010 at 6:06
Attachments:
Currently distributed jmathplot.jar is not signed. This causes problems for
using it with java 6_10 (browser asks user if he/she wants to block not signed
application form execution).
Original issue reported on code.google.com by [email protected]
on 21 Dec 2010 at 11:49
It would be really nice to have jmathplot
available from maven repository.
I am using Moea framwork and want to concatenate my file for this i am using following code.
package knapsackthesisconcatefiles;
import java.io.*;
public class ConcatenatedFiles {
static public void main(String arg[]) throws java.io.IOException {
//String folderName = "PROBLEM_AGENT400_TASK100";
//String folderName = "scalability-400agents";
String folderName = "no of items";
PrintWriter pw = new PrintWriter(new FileOutputStream("C:/Users/l155089/Desktop/knapsack project/MOEAFramework-2.11/MOEAFramework-2.11/test1/items-ALL-NONDOMINATED-COMBINED.txt"));
File file = new File("C:/Users/l155089/Desktop/knapsack project/MOEAFramework-2.11/MOEAFramework-2.11 /test1/"+folderName+"/");
File[] files = file.listFiles();
System.out.println("Processing 1 ");
for (int i = 0; i < files.length; i++) {
System.out.println("Processing 1 ");
File[] subFiles =null;
File[] tempSubFiles =null;
if(files[i].isDirectory()) {
tempSubFiles = files[i].listFiles();
if(tempSubFiles[0].isDirectory())
subFiles = tempSubFiles[0].listFiles(); //if only 1 nested folder
else
subFiles = tempSubFiles;
}
if (subFiles==null) continue;
for (int j = 0; j < subFiles.length; j++) {
if(!subFiles[j].getName().startsWith("FUN"))
continue;
System.out.println("Processing j "+j + subFiles[j].getPath() + "... ");
BufferedReader br = new BufferedReader(new FileReader(subFiles[j]
.getPath()));
String line = br.readLine();
while (line != null) {
pw.println(line);
line = br.readLine();
}
br.close();
}
System.out.println("Processing 2 ");
}
pw.close();
System.out.println("All files have been concatenated into ALL-NONDOMINATED-COMBINED.txt");
}
}
Exception in thread "main" java.lang.NullPointerException
at knapsackthesisconcatefiles.ConcatenatedFiles.main(ConcatenatedFiles.java:19)
this throw a null pointer exception. kindly help me.
What steps will reproduce the problem?
1. include the pckage
What is the expected output? What do you see instead?
expect it to the exist and for the tutorial to work as planned; it does not
exist, so cannot import anything from org.math.array.
What version of the product are you using? On what operating system?
2009 version, Windows 8
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 29 Jun 2014 at 8:24
I'm want to render some high definition data volume as a chart from image and serve as a web image resource.
To do this, is there any component out of AWT?
Is this a good solution?
// ... at the application initialization
System.setProperty("java.awt.headless", "true");
// ... controller method
// create your PlotPanel (you can use it as a JPanel)
Plot2DPanel plot = new Plot2DPanel();
// add a line plot to the PlotPanel
plot.addLinePlot("my plot", x, y);
// Create a buffered image with transparency
BufferedImage bimage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
// Draw the image on to the buffered image
Graphics2D bGr = bimage.createGraphics();
bGr.drawImage(plot.createImage(width, height), 0, 0, null);
bGr.dispose();
// ... serve the bimage as PNG resource
Does jmathplot support svg export? If not... is it planned for the future?
What steps will reproduce the problem?
1. Plot2DPanel.addLinePlot("", new double[]{1,2,3}, new double[] {4,5,6})
2. Plot2DPanel.addLinePlot("", new double[]{1,2}, new double[] {4,5})
3.
What is the expected output? What do you see instead?
according to the arguments (String, double[] X, double[] Y), #1 should be
plotting the follow data points(1,4), (2,5), (3,6) and #2 should plot (1,4) and
(2,5).
This does not happen for #2. #2 plots (1,2) and (4,5).
What version of the product are you using? On what operating system?
8/2009 download, XP
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 1 Apr 2011 at 7:46
Rotating the axislabel misalign the line plots.
I'm adding some line plots to my graph and want to rotate the axis label of the
y-axis.
Code Used:
panel.getAxis(0).setLabelPosition(0.5, -0.15);
panel.getAxis(1).setLabelAngle(-Math.PI / 2);
panel.getAxis(1).setLabelPosition(-0.15, 0.5); What is the expected output?
OS: Windows XP SP3
JAVA: 1.7
Original issue reported on code.google.com by [email protected]
on 6 Nov 2013 at 9:38
Attachments:
Shouldn't the icons (resources) in package org.math.plot.icons be contained in the distributed JAR file? They used to be in the older ZIP files but I cannot find them and a runtime (NullPointer) exception is thrown:
Exception in thread "main" java.lang.NullPointerException
at javax.swing.ImageIcon.(Unknown Source)
at org.math.plot.components.PlotToolBar.(PlotToolBar.java:61)
at org.math.plot.PlotPanel.addPlotToolBar(PlotPanel.java:149)
at org.math.plot.PlotPanel.(PlotPanel.java:59)
at org.math.plot.PlotPanel.(PlotPanel.java:67)
at org.math.plot.Plot2DPanel.(Plot2DPanel.java:31)
The Linux version of Maven, at least, is case sensitive, so where the pom currently has
<dependencies>
<dependency>
<groupId>com.github.yannrichet</groupId>
<artifactId>jmathio</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.github.yannrichet</groupId>
<artifactId>jmatharray</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
it should instead have
<dependencies>
<dependency>
<groupId>com.github.yannrichet</groupId>
<artifactId>JMathIO</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.github.yannrichet</groupId>
<artifactId>JMathArray</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
What steps will reproduce the problem?
Use Plot2DCanvas insted of PlotPanel.
I was using PlotPanel with the method:
addLinePlot(String, double[], double[])
When I changed to Plot2DCanvas it gave me a compilation error.
I Guess Plot2DCanvas should also have that method.
Original issue reported on code.google.com by [email protected]
on 21 Mar 2010 at 4:34
Hello,
Is it possible to create a line plot / multiple line plots, and force the x axis to display only integer values?
Also, is it possible for the y axis to display the values in 10^3 (for example) scale?
Thank you in advance,
Panagiotis
I run the following code in eclipse, i am sure i have include the jmathplot.jar :
double[] x = { 1.0, 2.0, 3.0 };
double[] y = { 4.0, 5.0, 6.0 };
// create your PlotPanel (you can use it as a JPanel)
Plot2DPanel plot = new Plot2DPanel();
// add a line plot to the PlotPanel
plot.addLinePlot("my plot", x, y);
// put the PlotPanel in a JFrame, as a JPanel
JFrame frame = new JFrame("a plot panel");
frame.setContentPane(plot);
frame.setVisible(true);
Then comes the error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/math/io/StringPrintable
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.math.plot.canvas.PlotCanvas.(PlotCanvas.java:491)
at org.math.plot.canvas.Plot2DCanvas.(Plot2DCanvas.java:25)
at org.math.plot.Plot2DPanel.(Plot2DPanel.java:31)
at cn.hhj.Test.main(Test.java:14)
Caused by: java.lang.ClassNotFoundException: org.math.io.StringPrintable
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 16 more
I can't figure it out, and i can't find the org.math.io.StringPrintable Class, please help me~~~
I have a problem , i working with intellijIdea and get below error :
Exception in thread "main" java.lang.NullPointerException
at javax.swing.ImageIcon.(ImageIcon.java:217)
at org.math.plot.components.PlotToolBar.(PlotToolBar.java:61)
at org.math.plot.PlotPanel.addPlotToolBar(PlotPanel.java:149)
at org.math.plot.PlotPanel.(PlotPanel.java:59)
at org.math.plot.PlotPanel.(PlotPanel.java:67)
at org.math.plot.Plot2DPanel.(Plot2DPanel.java:31)
at Test.main(Test.java:12)
my code:
import javax.swing.*;
import org.math.plot.*;
public class Test {
public static void main(String[] args) {
double[] x = { 1, 2, 3, 4, 5, 6 };
double[] y = { 45, 89, 6, 32, 63, 12 };
Plot2DPanel plot = new Plot2DPanel();
plot.addLinePlot("my plot", x, y);
JFrame frame = new JFrame("a plot panel");
frame.setSize(600, 600);
frame.setContentPane(plot);
frame.setVisible(true);
}
}
I could not find a license file and the java files do not contain any information on the license. Could you please tell the license? Is it LGPL?
Is it possible for all the axes to intersect 0,0,0 so it is easier to see which values are above/below the origin? I've already tried axis.setOrigin() to no avail.
Some of the examples are using the setAxesLabels() method but this method is not available, instead there is setAxisLabels() method, so the examples should be adjusted accordingly.
How can I change the width of the lines??
The dependency item in the README.md file will cause a maven error
Could not find artifact com.github.yannrichet:jmathplot:jar:1.0 in central (https://repo.maven.apache.org/maven2)
<dependencies>
...
<dependency>
<groupId>com.github.yannrichet</groupId>
<artifactId>jmathplot</artifactId>
<version>1.0</version>
</dependency>
...
</dependencies>
Please update the artifactId to <artifactId>JMathPlot</artifactId>
, version>1.0.1</version>
to avoid such error.
The color of the bars is translucent, how can we make it solid? I tried using the opaque feature but I don't think that it works.
More of a feature request... But how complicated would to be to extend PlotPanel and build a rose plot? Would be a fantastic addition!
I try this to draw the function 1/x and ln(x). For 1/x this library works well with zero division, but for ln(x) the library failed with number <=0 (situation with DOUBLE.POSITIVE_INFINITY and DOUBLE.NEGATIVE_INFINITY).
In the GridPlotsExample file. However, there is no directory called array.
What steps will reproduce the problem?
1. generate a plot
2. click on the "save graphics as a .PNG file" button
3. enter name, select location, and choose "save."
What is the expected output? What do you see instead?
expected: plots are saved as .png
instead: plots are saved as .file
What version of the product are you using? On what operating system?
latest version of product on windows 8.1
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 30 Jun 2014 at 11:06
I have this profile I'm plotting (line plot), and some of the values are (deliberately) set to NaN (in places where no data is available). Would it be possible to just "skip" these values, instead of treating them as 0 (NB: I think that's what's happening, but I could be wrong on the precise behaviour). In essence, I'd like to see the line plot with just a gap wherever the NaN(s) occur.
Thanks and kudos for the great library!
When the lineplot is created and there are only two points in the line, the library mixes xvalues and yvalues (it takes x1 and y1 from x[] and x2 and y2 from y[] instead of x1,x2 from x[] and y1,y2 from y[])
I discovered this with a plot that looked like this:
public class TestPlot {
public static void main(String[] argv){
Plot2DPanel plot = new Plot2DPanel();
double[] xVals1={1.439552797E12};
double[] yVals1={78.01681253978265};
plot.addLinePlot("group1",xVals1, yVals1);
double[] xVals2={1.439547397E12,1.439549977E12};
double[] yVals2={132.63444272447055,123.83742313295052};
plot.addLinePlot("group2",xVals2, yVals2);
double[] xVals3={1.439547337E12,1.439552977E12};
double[] yVals3={125.65397959192407,77.27720607952492};
plot.addLinePlot("group4",xVals3, yVals3);
double[] xVals4={1.439547397E12,1.439548177E12,1.439548297E12};
double[] yVals4={129.3471436797041,133.2500131743693,149.82183519985475};
plot.addLinePlot("group5",xVals4, yVals4);
double[] xVals6={1.439547877E12,1.439548657E12};
double[] yVals6={72.8865784844678,71.04753151587994};
plot.addLinePlot("group9",xVals6, yVals6);
plot.addLegend(plot.NORTH);
plot.setToolTipText("DATA");
JFrame frame = new JFrame("Demo data");
frame.setContentPane(plot);
frame.setSize(800, 600);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
And the result is completely wromd due to x and y totally different scales:
This is very disrturbing and looks like a bug.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.