+ Reply to Thread
Results 1 to 7 of 7

Thread: Tick marks

  1. #1
    cerbere is offline x10Hosting Member cerbere is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    51

    Tick marks

    Plotting data is easy, but putting tick marks
    (with values) on the horizontal and vertical
    axises is harder. Plotting an arbitrary part
    of an arbitrary dataset (x and y values) is what
    I want to do, generating ticks accordingly.

    The function to do this should take as input :

    - low : left value
    - high : right value of the plot
    - density : approximate number of tick marks on the axis

    and produce as output :

    - list of tick mark positions in the axis' units
    - labels (character strings for above)

    Tick marks should of course be "rounded", i.e. fall
    on the simplest numbers possible.

    Example 1
    Input :
    low = -3.2564
    high = 11.926
    density = 4

    Output :
    Tick marks at -3.0, 0.0, 3.0, 6.0, 9.0

    Example 2
    Input :
    low = 10.0017
    high = 10.0058
    density = 8

    Output :
    Ticks at 10.002 10.0025 10.003 10.0035 10.004 10.0045 10.005 10.0055

    A refinement is to also produce minor, unlabeled ticks between
    major (labeled) ticks.

    All plotting packages do that for you, but I want to
    write my own, to have better control over the final
    appearance of the plot.

    Any hints, suggestions or methods greatly appreciated !

  2. #2
    Scoochi2's Avatar
    Scoochi2 is offline x10 Sophmore Scoochi2 is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Southport!
    Posts
    185

    Re: Tick marks

    I'm going to be honest here: I have absolutely no idea what you're trying to do.
    What do you mean by 'tick marks'?

    Are you trying to plot a graph? If so, what are you using to plot it? A program? A programming language? Which? What data are you trying to plot with? And what have you tried? What worked and what didn't?
    If anyone can see it, my post was meant for anyone who reads it. Don't take it personally or think I'm being condescending... :nuts:

  3. #3
    xmakina's Avatar
    xmakina is offline x10 Lieutenant xmakina is an unknown quantity at this point
    Join Date
    May 2008
    Location
    England
    Posts
    265

    Re: Tick marks

    Flash is probably your best option. That or javascript.
    IF($this->$post.content() == "SEE SIG"){
    w3Schools and Google
    }

  4. #4
    cerbere is offline x10Hosting Member cerbere is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    51

    Re: Tick marks

    To clarify my question, here are some ticks for you...

    That plot was generated in Perl using the GD::Graph
    module. That module offers minimal support over data
    windowing, especially compared to commercial
    (and expensive) packages like Matlab and others.

    My question is NOT about how to produce nice plots;
    it is specifically about how, given the low- and high-limits
    of an axis, produce a set of appropriate ticks at a
    given density.
    Attached Thumbnails Attached Thumbnails Tick marks-gddampput.jpg  

  5. #5
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    Re: Tick marks

    I am totally going off my head with this:

    you could have a div with fixed height and border-right: and tell PHP to put in the width:, and repeat it as many times as need be using an if statement

  6. #6
    xmakina's Avatar
    xmakina is offline x10 Lieutenant xmakina is an unknown quantity at this point
    Join Date
    May 2008
    Location
    England
    Posts
    265

    Re: Tick marks

    Oh. I thought you meant ticks as in the mark you put against something correct. You meant grid lines.

    And I have no idea. You're going to need some kind of dedicated chart drawing package. The only other thing I can think of is something in flash still or *perhaps* use the PHP image creator but you'd have to be bloody good at PHP to pull that off.
    IF($this->$post.content() == "SEE SIG"){
    w3Schools and Google
    }

  7. #7
    cerbere is offline x10Hosting Member cerbere is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    51

    Re: Tick marks

    Again, I am not looking for a package or application to do
    that for me, I am looking for an ALGORITHM. Whether I
    implement it in Perl, PHP or effing Cobol is right now
    totally unimportant for me. Please re-read my preceeding
    posts with that more abstract perspective.

    Related reading at :
    http://phplot.sourceforge.net/phplotdocs/ref-ticks.html
    http://phplot.sourceforge.net/phplotdocs/ex-lines2.html
    (see how the ticks are placed at "ugly" values,
    instead of 0.0 0.4 0.8 1.2 and so on ?)
    http://search.cpan.org/dist/GDGraph/Graph.pm

+ Reply to Thread

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
x10hosting free hosting for the masses
dedicated servers