Results 1 to 6 of 6
  1. #1
    Nodame is offline Member
    Join Date
    Oct 2013
    Posts
    2
    Rep Power
    0

    Default How to Plot data in Java using GUI?

    I am using Eclipse GUI with the Windows builder. My code provides four arraylists (of same length). I am trying to plot each one of the arraylists against time axis starting at (0, 1, 2,...., arraylistlength). How do I go about doing that?

    Can Java do that? Or would I need to plot somewhere else like in MATLAB and somehow export my plots later?
    Any suggestion is very appreciated.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,987
    Rep Power
    9

    Default Re: How to Plot data in Java using GUI?

    You can do custom painting: Lesson: Performing Custom Painting (The Java™ Tutorials > Creating a GUI With JFC/Swing)

    Or you can use something like JFreeChart: JFreeChart
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Nodame is offline Member
    Join Date
    Oct 2013
    Posts
    2
    Rep Power
    0

    Default Re: How to Plot data in Java using GUI?

    Quote Originally Posted by KevinWorkman View Post
    You can do custom painting: Lesson: Performing Custom Painting (The Java™ Tutorials > Creating a GUI With JFC/Swing)

    Or you can use something like JFreeChart: JFreeChart
    thanks for your reply Kevin, but is "Custom Painting" for painting using the mouse? What I am trying to achieve, is to use the data output from my code, to plot a 2-D graph.

    Maybe JFreeChart would be more indicated in this case. I will explore your provided link.

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,987
    Rep Power
    9

    Default Re: How to Plot data in Java using GUI?

    Custom painting is exactly that, custom painting. You can paint whatever you want, including a 2d graph. The term "painting" refers to the component drawing itself to the screen, not the user physically painting something.. although you could do that as well.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,097
    Rep Power
    6

    Default Re: How to Plot data in Java using GUI?

    Well, you could BUILD that as well. Java is not a magic wand that makes things happen, programmers do that. But programmers also create pre-built libraries which other programmers can reuse, so perhaps there is already some graph plotting API available somewhere to be found by people who have made themselves qualified to do things like this...
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  6. #6
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,777
    Rep Power
    5

    Default Re: How to Plot data in Java using GUI?

    Go to the Java Software forum at this site. On the right side of your browser, click search and type in the word 'plot'. Then click search. I got about 30 hits.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. set increments in data plot
    By lamorak24 in forum Advanced Java
    Replies: 1
    Last Post: 12-19-2011, 07:01 AM
  2. How to plot the graph,where the data from text file?
    By Haryanti in forum New To Java
    Replies: 2
    Last Post: 12-01-2011, 06:11 PM
  3. java graph plot taking file data
    By niloR19 in forum AWT / Swing
    Replies: 3
    Last Post: 11-28-2011, 06:56 PM
  4. How to continuously plot GPS data (Lat/Long) ?
    By JOsbeck in forum AWT / Swing
    Replies: 1
    Last Post: 10-21-2009, 08:48 PM
  5. Plot 2D graph in Java from RS-232 data
    By spratana in forum Java 2D
    Replies: 4
    Last Post: 02-11-2009, 06:49 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •