Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By pbrockway2

Thread: set increments in data plot

  1. #1
    lamorak24 is offline Member
    Join Date
    Dec 2011
    Rep Power

    Default set increments in data plot


    I am working on a project for school and I have all the important parts done, however I am having trouble writing an algorithm for setting the grid increments for a graph.

    The increments must be a power of 10 multiplied by 1, 2 or 5 (1, 2, 6, 10, 20, 50, 100, 200, 500 etc.

    I cant just set it to be huge because the points that will be graphed must be stretched across a large part of the graph.

    So i need to write an algorithm that will know the max value for X and Y to be entered and then come up with the increments.


  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    New Zealand
    Rep Power

    Default Re: set increments in data plot

    What have you come up with so far?

    If you're stuck for ideas try taking a piece of paper, picking a number at random and deciding what increments you would use so that the number appeared close to the edge of the paper. Pay attention to your thought processes and ask yourself why you choose that increment and not a larger or smaller one. This may form the basis of an algorithm that you can make precise and use to write your code.

    Apart from anything else such an exercise may help you get a sharper idea of what is actually needed. It seems to me that merely knowing the maximum value is not enough to decide the increment.
    Norm likes this.

Similar Threads

  1. 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, 07:11 PM
  2. java graph plot taking file data
    By niloR19 in forum AWT / Swing
    Replies: 3
    Last Post: 11-28-2011, 07:56 PM
  3. Pre- and post-increments
    By SirFalcon in forum New To Java
    Replies: 6
    Last Post: 10-29-2009, 04:29 AM
  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, 07:49 PM

Posting Permissions

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