Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svg: Rounding errors in Y labels #18

Closed
Ploppz opened this issue Feb 14, 2019 · 2 comments · Fixed by #41
Closed

svg: Rounding errors in Y labels #18

Ploppz opened this issue Feb 14, 2019 · 2 comments · Fixed by #41
Labels
Milestone

Comments

@Ploppz
Copy link
Contributor

Ploppz commented Feb 14, 2019

n

The only thing that is visible of the top-most number os 0000000005, but it's actually 5.60000000005.

Here is the svg file: http://sprunge.us/QdSTRO

Here is the input data to plotlib:

[(10.0, 5.554613094409367), (15.0, 5.571373799732846), (20.0, 5.580786175835321), (25.0, 5.594389457136185), (30.0, 5.588413866453277), (35.0, 5.581090728388583), (40.0, 5.564882932873482), (45.0, 5.5655230910515785), (50.0, 5.575694697314061), (55.0, 5.563091468885199), (60.0, 5.505139387304649), (65.0, 5.435932668847201), (70.0, 5.392844844207445), (75.0, 5.375070392542875), (80.0, 5.370750095478286), (85.0, 5.355376048261111), (90.0, 5.348519533974179), (95.0, 5.344626082423696), (100.0, 5.3274562508487024), (105.0, 5.329445069896911), (110.0, 5.330588028449412), (115.0, 5.335541125490482), (120.0, 5.32486693110636), (125.0, 5.326145859928657), (130.0, 5.3267627195905245), (135.0, 5.324000652981454), (140.0, 5.327175540775914), (145.0, 5.326936653662645), (150.0, 5.326319101633424), (155.0, 5.3195335123314775), (160.0, 5.318547022604354), (165.0, 5.318984347429394), (170.0, 5.317016756493654), (175.0, 5.320569820967218), (180.0, 5.321774086633875), (185.0, 5.3192970755289), (190.0, 5.308293371083831), (195.0, 5.286882630232821), (200.0, 5.264732108073603), (205.0, 5.254215082718998), (210.0, 5.242928735217475), (215.0, 5.229751139000503), (220.0, 5.202672283250928), (225.0, 5.180185883522078), (230.0, 5.156744670958561), (235.0, 5.134800944115094), (240.0, 5.127834870263292), (245.0, 5.121960601961146), (250.0, 5.115420107250173), (255.0, 5.1122765198698215), (260.0, 5.107215561118251), (265.0, 5.09911659020747), (270.0, 5.088330837894482), (275.0, 5.085926681262303), (280.0, 5.084239392471663), (285.0, 5.083673161411417), (290.0, 5.084211846974766), (295.0, 5.081707528453846), (300.0, 5.078245582248812)]
[(10.0, 5.554613094409367), (15.0, 5.571373799732846), (20.0, 5.580786175835321), (25.0, 5.594389457136185), (30.0, 5.588413866453277), (35.0, 5.585615659886031), (40.0, 5.587206724645493), (45.0, 5.571298729005933), (50.0, 5.558131825575247), (55.0, 5.544393316154019), (60.0, 5.53813614296059), (65.0, 5.523535700145619), (70.0, 5.4996913881052105), (75.0, 5.472378149492847), (80.0, 5.45374886101448), (85.0, 5.4324287369128195), (90.0, 5.410797420874291), (95.0, 5.393886671682631), (100.0, 5.361498295387429), (105.0, 5.320841464177755), (110.0, 5.277655355217769), (115.0, 5.242304398506202), (120.0, 5.220685015560172), (125.0, 5.197350800910618), (130.0, 5.180128027249545), (135.0, 5.165155622245212), (140.0, 5.157291822432492), (145.0, 5.160809304386804), (150.0, 5.1621050182918875), (155.0, 5.164784237269466), (160.0, 5.170044410029799), (165.0, 5.176610149099485), (170.0, 5.178943153694296), (175.0, 5.180969369533339), (180.0, 5.181202553209083), (185.0, 5.180421437704337), (190.0, 5.183487260078211), (195.0, 5.190838759095146), (200.0, 5.19805536865893), (205.0, 5.205331656977181), (210.0, 5.211848936948826), (215.0, 5.215886880659793), (220.0, 5.2191099964160355), (225.0, 5.214903056232922), (230.0, 5.209356626646803), (235.0, 5.210631952871428), (240.0, 5.212151991487046), (245.0, 5.214216204923996), (250.0, 5.206883052633969), (255.0, 5.207739240362648), (260.0, 5.207163350519838), (265.0, 5.205506780136554), (270.0, 5.207203657870471), (275.0, 5.206951561696365), (280.0, 5.208947475530317), (285.0, 5.20313975184542), (290.0, 5.204589733890532), (295.0, 5.205217982298412), (300.0, 5.202972315747025)]
[(10.0, 5.656477554152827), (15.0, 5.518753423352734), (20.0, 5.538369232714198), (25.0, 5.523798152568706), (30.0, 5.53725576641077), (35.0, 5.5218183424410014), (40.0, 5.523350461669418), (45.0, 5.531653410599423), (50.0, 5.519886110360921), (55.0, 5.495504075954746), (60.0, 5.483291143318121), (65.0, 5.485041358928483), (70.0, 5.49360138294122), (75.0, 5.4993546868179255), (80.0, 5.495793588413891), (85.0, 5.499689269619098), (90.0, 5.502345293847687), (95.0, 5.499380450456559), (100.0, 5.4860808187812), (105.0, 5.474888395868257), (110.0, 5.469030439040476), (115.0, 5.459149366952276), (120.0, 5.448213297843009), (125.0, 5.433420015075955), (130.0, 5.42028426873691), (135.0, 5.4039370730625), (140.0, 5.389449304230735), (145.0, 5.374739029115512), (150.0, 5.357460575330139), (155.0, 5.340662553581878), (160.0, 5.313241383144196), (165.0, 5.269444679770821), (170.0, 5.238487323826094), (175.0, 5.2086113937648335), (180.0, 5.189242228426556), (185.0, 5.1744945041051), (190.0, 5.159483304652246), (195.0, 5.14430017185943), (200.0, 5.117318556745862), (205.0, 5.10072786906999), (210.0, 5.084061503647151), (215.0, 5.075762136466544), (220.0, 5.068552343275285), (225.0, 5.062863726182678), (230.0, 5.051815330935621), (235.0, 5.031358091612719), (240.0, 5.021260071788471), (245.0, 5.010255285851625), (250.0, 5.003961940532494), (255.0, 4.99636579001612), (260.0, 4.987814326450532), (265.0, 4.980644666607665), (270.0, 4.963432971258708), (275.0, 4.956729825460665), (280.0, 4.948738350016256), (285.0, 4.943941669083361), (290.0, 4.93958132651051), (295.0, 4.933664938830087), (300.0, 4.928992049266768)]
@Ploppz
Copy link
Contributor Author

Ploppz commented Feb 15, 2019

A fix for this: Ploppz@8c3670b But it builds on @superfunc's work which has yet to be merged.

@milliams
Copy link
Owner

milliams commented Mar 2, 2019

This is indeed a bug I've seen creep in in a few situations. Your fix looks sane so I'd invite you to put a PR up for review.

In the future, we'd want to avoid hardcoding the precision and support scientific notation but that can come as a separate feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants