Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 479995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:50:53+00:00 2026-05-13T00:50:53+00:00

I’m writing a 2D plotter, and along the X- and Y-axis I have markers

  • 0

I’m writing a 2D plotter, and along the X- and Y-axis I have markers with printed values. Now my question is: how do I find suitable distances?

My method (for a numeric axis) is so far:

  • I know the height of the axis on screen in pixels
  • Decide an optimal distance between markers in pixels (what looks good on screen …), for example 32 pixels.
  • Recalculate the pixel count to axis value (If the axis is 320 pixels and the range of the axis is 0-40 °C for example, the value is 32 * (40/320) = 4. So the optimal distance is 4 °C.)
  • Start with a distance of 1 °C. If the distance is bigger than the optimal distance, divide it by two until less then the optimal distance. And likewise, if the distance is less than the optimal distance, multiply it by two until larger than the optimal distance.

This works, but it does not give me the same distances as I would have selected by hand. For example: if the range is 0-1000, I would decide one of the following distances:

  • 1000 (0, 1000
  • 500 (0, 500, 1000)
  • 250 (0, 250, 500, 750, 1000)
  • 200 (0, 200, 400, 600, 800, 1000)
  • 100 (0, 100, …, 900, 1000)
  • 50 (0, 50, …, 950, 1000)

and so on …

Do you have any clever idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T00:50:54+00:00Added an answer on May 13, 2026 at 12:50 am

    One suggestion that might help is to predetermine what distances will look good, then define a lookup table based on size of range on your axes. But, to save having to have too much data, make sure that your axes are normalised back to a standard range.

    So, for example, calculate the range, then normalise back to a range of 1-100, then find the nearest value in your lookup table and use that distance.

    If you have Excel you could look at the results they create and see if you can glean a useful algorithm from that, although I often find that I need to manually override the distances that Excel throws up for clarity. It might turn out that having manual override is a vital feature for your application too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.