Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-29-2007, 01:45 AM
Member
 
Join Date: Jul 2007
Posts: 35
silvia is on a distinguished road
Help with graph code example
Hi, I've been trying so long and i could not solve any of the problems (below) that I've been having for some time. If any of you could help out with any of the problems, that's be absolutely amazing.
  1. Graph Class Library
    that's the website from which i got my plotting codes/classes for a plot that supposedly takes a set of data from a different calculating program (example 3 code is the one where you can load data). I'm looking at the graph code example3 and it's not obvious to me how to call up the data for the graph. is it where it says "DATA"? if the data file is called output.txt would i just substitute "output.txt" for "DATA"?
  2. How would i make it so that my outout.txt file from a calculating program is composed of two columns (so basically a set of data, x coordinates and y coordinates)?
  3. In the following equation, i want P to be varying b/t two given constants Pmax and Pmin. how would i do that?

public double I0(double Vb, double P, double Pbath) {
return ((Pbath-P)/Vb);
}

Thanks
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-29-2007, 11:16 PM
Senior Member
 
Join Date: Jul 2007
Posts: 1,022
hardwired is on a distinguished road
I'm looking at the graph code example3 and it's not obvious to me how to call up the data for the graph. is it where it says "DATA"?
This line in the applet
Code:
String data = getParameter("DATA");
reads the data file name from the applet tag. To find it you look at the source (View menu/Page -> "view source") and find that the applet is in the middle row of a frameset. Copy the url ("example3_app.html") for this frame and load it into the address bar. The applet tag has the param tag
Code:
<param name=data value="elliptical.data">
which shows the data file name for the applet.
if the data file is called output.txt would i just substitute "output.txt" for "DATA"?
If you want to use the applet tag and its param tag you would substitute "output.txt" for the value of "elliptical.data". If you want to put it directly into the applet you could write
Code:
String data = "output.txt";
How would i make it so that my outout.txt file from a calculating program is composed of two columns (so basically a set of data, x coordinates and y coordinates)?
Make up a BufferedWriter to write the data out to the "output.txt" file. For each x, y value skip a space in between and after the pair write a newline with myWriter.newLine().
In the following equation, i want P to be varying b/t two given constants Pmax and Pmin. how would i do that?
Let's say you have data 250 <= x <= 1000 and want to scale it into 50 <= y <= 100.
To scale the units
Code:
100 - 50 scale = ---------- 1000 - 250 Scale the x interval and add the minimum y value. 50(x - 250) y = ----------- + 50 750
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java chart & graph lib saturdaybugs Java 2D 1 04-24-2008 02:59 PM
Need Help for Dot Plot Graph BHCluster Java 2D 5 04-15-2008 03:54 PM
Graph program code,hardnut Javashak Advanced Java 0 03-24-2008 04:25 PM
Graph DPS and BFS implementation hey New To Java 1 01-09-2008 10:19 PM
Problems getting Graph to show rhivka New To Java 6 07-31-2007 06:21 AM


All times are GMT +3. The time now is 10:23 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org