Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a graph where on my Y axis , I have price and on X axis I have period/time.

My range on Y axis is from 10 (lower limit) to 200 (upper limit), so to draw the point on graph I need the Y position of the value for example if my price is 100.50 then how should I calculate Y position of this price .


share|cite|improve this question

You have $200-10=190$ values on the Y-axis and you start at $10$. So value $y$ should be placed at $$\frac{y-10}{190}$$ of the way up the axis.

share|cite|improve this answer
OP may want to worry about truncation details. There are 191 pixels along the y axis if 10 and 200 are both included (though the length is 190), and the result will have to be forced to an integer. The classic way is to round: use $\lfloor \frac {y-10}{190}+0.5\rfloor$, but the idea is the same. – Ross Millikan Jul 25 '12 at 13:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.