plot icon indicating copy to clipboard operation
plot copied to clipboard

Write a wiki article on padding code

Open eaburns opened this issue 11 years ago • 1 comments

Original issue 73 created by eaburns on 2012-08-24T13:13:39.000Z:

A wiki article could help demystify the plot's padX and padY functions a lot.

X transform is x * (da.Max - da.Min) + da.Min:

l.X * (newMax - newMin) + newMin = da.Min - l.Min.X (we subtract l.Min.X because it's given as a negative value). So, the X location of our left-most glyph will transform it to a location that has room for its left-most edge to lie directly on da.Min.

We also want:

r.X * (newMax - newMin) + newMin = da.Max - (r.Min.X + r.Size.X). This is the same as above, but we are dealing with the right-most edge of the right-most glyph and we want it to end up at da.Max.

eaburns avatar Mar 15 '15 12:03 eaburns

Comment #1 originally posted by eaburns on 2013-02-20T19:24:28.000Z:

<empty>

eaburns avatar Mar 15 '15 12:03 eaburns