Plotting 2D grpah in Java  
Author Message
Allan Bruce





PostPosted: 2005-10-12 21:11:00 Top

java-programmer, Plotting 2D grpah in Java I was wondering if there is some package available that can plot 2D graphs
in Java? I have developed a piece of software whcih simulates behaviours of
models and at the moment I save the data to file and use Excel to view it.
I was hoping to interface something directly with my Java program to view
the results. Is there anything out there?

Thanks,
Allan


 
Ross Bamford





PostPosted: 2005-10-12 21:43:00 Top

java-programmer >> Plotting 2D grpah in Java On Wed, 12 Oct 2005 14:11:07 +0100, Allan Bruce <email***@***.com> wrote:

> I was wondering if there is some package available that can plot 2D
> graphs
> in Java? I have developed a piece of software whcih simulates
> behaviours of
> models and at the moment I save the data to file and use Excel to view
> it.
> I was hoping to interface something directly with my Java program to view
> the results. Is there anything out there?
>
> Thanks,
> Allan
>
>

Try:

http://www.jfree.org/jfreechart/index.php

It's free and quite capable.

--
Ross Bamford - email***@***.com
 
Mark Haase





PostPosted: 2005-10-13 0:36:00 Top

java-programmer >> Plotting 2D grpah in Java In article <email***@***.com>,
"Allan Bruce" <email***@***.com> wrote:

> I was wondering if there is some package available that can plot 2D graphs
> in Java? I have developed a piece of software whcih simulates behaviours of
> models and at the moment I save the data to file and use Excel to view it.
> I was hoping to interface something directly with my Java program to view
> the results. Is there anything out there?
>
> Thanks,
> Allan

Allan, if you're interested in scatter plots only, I wrote a handy
applet you might find useful:

http://habitforming-sw.com/ffw

Look at the simulations to see the graph in action, the pertinent source
files (available on line) are StatSource, StatListener, and BasicGraph.

Its not rocket surgery but its free and simple. If you have questions or
comments (or if you improve it at all!) please contact me.

--
|\/| /| |2 |<
mehaase(at)gmail(dot)com
 
 
Roedy Green





PostPosted: 2005-10-13 4:30:00 Top

java-programmer >> Plotting 2D grpah in Java On Wed, 12 Oct 2005 14:11:07 +0100, "Allan Bruce" <email***@***.com> wrote
or quoted :

>I was wondering if there is some package available that can plot 2D graphs
>in Java?
see http://mindprod.com/jgloss/graph.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
 
Allan Bruce





PostPosted: 2005-10-13 19:38:00 Top

java-programmer >> Plotting 2D grpah in Java
"Ross Bamford" <email***@***.com> wrote in message
news:email***@***.com...
> On Wed, 12 Oct 2005 14:11:07 +0100, Allan Bruce <email***@***.com> wrote:
>
>> I was wondering if there is some package available that can plot 2D
>> graphs
>> in Java? I have developed a piece of software whcih simulates
>> behaviours of
>> models and at the moment I save the data to file and use Excel to view
>> it.
>> I was hoping to interface something directly with my Java program to view
>> the results. Is there anything out there?
>>
>> Thanks,
>> Allan
>>
>>
>
> Try:
>
> http://www.jfree.org/jfreechart/index.php
>
> It's free and quite capable.
>
> --
> Ross Bamford - email***@***.com

Hi - This looks quite good, but I cannot get it compiled and I would have to
pay to get the developers guide.
Thanks
Allan


 
 
Allan Bruce





PostPosted: 2005-10-13 19:51:00 Top

java-programmer >> Plotting 2D grpah in Java
"Roedy Green" <email***@***.com> wrote in
message news:email***@***.com...
> On Wed, 12 Oct 2005 14:11:07 +0100, "Allan Bruce" <email***@***.com> wrote
> or quoted :
>
>>I was wondering if there is some package available that can plot 2D graphs
>>in Java?
> see http://mindprod.com/jgloss/graph.html
> --
> Canadian Mind Products, Roedy Green.
> http://mindprod.com Again taking new Java programming contracts.

Most of these are commercial products - I require something free as I am
developing academic software.
Thanks
Allan


 
 
Allan Bruce





PostPosted: 2005-10-13 19:52:00 Top

java-programmer >> Plotting 2D grpah in Java
"Mark Haase" <email***@***.com> wrote in message
news:email***@***.com...
> In article <email***@***.com>,
> "Allan Bruce" <email***@***.com> wrote:
>
>> I was wondering if there is some package available that can plot 2D
>> graphs
>> in Java? I have developed a piece of software whcih simulates behaviours
>> of
>> models and at the moment I save the data to file and use Excel to view
>> it.
>> I was hoping to interface something directly with my Java program to view
>> the results. Is there anything out there?
>>
>> Thanks,
>> Allan
>
> Allan, if you're interested in scatter plots only, I wrote a handy
> applet you might find useful:
>
> http://habitforming-sw.com/ffw
>
> Look at the simulations to see the graph in action, the pertinent source
> files (available on line) are StatSource, StatListener, and BasicGraph.
>
> Its not rocket surgery but its free and simple. If you have questions or
> comments (or if you improve it at all!) please contact me.
>
> --
> |\/| /| |2 |<
> mehaase(at)gmail(dot)com

Hi there,
This is fairly close to what I need, but I need it to run in a JFrame, I had
a quick look at the source, and your code seems to rely on getParameter()
from the Applet class. I dont suppose you have a version of this which runs
in a JFrame do you?
Thanks.
Allan


 
 
Mark Haase





PostPosted: 2005-10-14 0:17:00 Top

java-programmer >> Plotting 2D grpah in Java In article <email***@***.com>,
"Allan Bruce" <email***@***.com> wrote:

> Hi there,
> This is fairly close to what I need, but I need it to run in a JFrame, I had
> a quick look at the source, and your code seems to rely on getParameter()
> from the Applet class. I dont suppose you have a version of this which runs
> in a JFrame do you?
> Thanks.
> Allan

Nope, no JFrame version. This was just written on a project I did where
public demonstrations were important, and so applets were an easy way to
distribute the software and reliably run it.

Then again, it wouldn't be hard to convert.

I only use getParameter to get information about how to set up the
display, i.e. what spacings between elements, what variables to list on
each axis, etc. You could replace these with hardcoded values or write a
function to set them from the calling code.

Then do a standard Applet -> JFrame conversion and you're done.

--
|\/| /| |2 |<
mehaase(at)gmail(dot)com
 
 
Andrew Thompson





PostPosted: 2005-10-14 6:59:00 Top

java-programmer >> Plotting 2D grpah in Java Mark Haase wrote:

> I only use getParameter to get information about how to set up the
> display, i.e. what spacings between elements, what variables to list on
> each axis, etc. You could replace these with hardcoded values or write a
> function to set them from the calling code.

The logical equivalent of an applet's getParameter() method
would be to get the parameters via the args[] of main().

All the (combined) applet/application's I've written work that
way.

> Then do a standard Applet -> JFrame conversion and you're done.

I object to 'conversions' from one to the other, when you can
'convert' the code to support *both* applet and application
deployment.

[ struggling to think of an example that is open source ]
Roedy's 'WassUp' applet application is a good example
of a combined applet/application, ..though it does not
ask for parameters.
 
 
Roedy Green





PostPosted: 2005-10-15 14:26:00 Top

java-programmer >> Plotting 2D grpah in Java On Thu, 13 Oct 2005 22:59:21 GMT, Andrew Thompson
<email***@***.com> wrote or quoted :

>[ struggling to think of an example that is open source ]
>Roedy's 'WassUp' applet application is a good example
>of a combined applet/application, ..though it does not
>ask for parameters.

You can do it by simulating an Applet.getParameter or I pass the
Applet a parameter more simply with a second Applet constructor like
this code from JDisplay.


public static void main ( String args[] )
{
if ( args.length == 0 ) { throw new IllegalArgumentException(
"missing url parameter" ); }
final JDisplay applet = new JDisplay( args[ 0 ] );
final Frame frame = new Frame( titleString + " " +
versionString );

--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.