Skip to main content
gamedev.net
🔒 Locked

Logarithmic Chart

Started by onez5827 Nov 7, 2004 at 10:13 PM 2 replies 650+ views
Original Post
onez5827
onez5827
I'm tring plot some coordinates on a logarithmic scale on a chart. A move from 10 to 20 should have the same magnitude as a move from 60 to 120 on the grids and legend. I assumed this involves the log function? Any help is appreciated
LilBudyWizer
LilBudyWizer
That doesn't necessarily involve a log function. 60=6*10 and 120=6*20 so that could be linear. Basically with your chart the left side is one value of the data and the right side is some other value. Your chart starts at some position and ends at some other position. Say your data goes from sd to ed and your chart goes from ss to es. So given data value x it's screen position is ss+(x-sd)/(ed-sd)*(es-ss). You do that in both the x and y directions. Log scales are just the same except you convert the data first. So ss+(log(x)-log(sd))/(log(ed)-log(sd))*(es-ss). You are just plotting the log of the data instead of the data.
Keys to success: Ability, ambition and opportunity.
joanusdmentia
joanusdmentia
Quote:
Original post by LilBudyWizer
That doesn't necessarily involve a log function. 60=6*10 and 120=6*20 so that could be linear.

I challenge you to draw me a linear curve that fits his description :)

Quote:
You are just plotting the log of the data instead of the data.

Yep, what he said. More specifically, you're plotting the log of the data on a linear scale.
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The nly verdict is vengeance; a vendett o
onez5827
onez5827
Thank you for the formulas, they made it easier to plot the points. Now that I can plot points on semi log scale on the y-axis, how should I make a formula to construct the y-axis legend values, allowing some space ahead of the min and max values?

I am starting to work with coordinates for charts alot. What kind of math should I learn that would help me better understand relationships between World and device coordinates, besides log? Any suggestions at all appreciated.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.