Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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 .

Thanks.

share|improve this question
add comment

1 Answer 1

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|improve this answer
1  
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
add comment

Your Answer

 
discard

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.