PharmCat / ForestPlot.jl

A simple package to draw forest plots for meta-analysis study
MIT License
3 stars 0 forks source link

forestplot([[0.2,0.7]]) works, but forestplot([[0.2,0.6]]) does not. #2

Closed Jan-van-Waaij closed 2 weeks ago

Jan-van-Waaij commented 1 month ago

Hallo!

I am using your package to compare credible sets for different situations. If the interval is small, I get "ArgumentError: range step cannot be zero". So for example forestplot([[0.2,0.6]]) gives an error, but forestplot([[0.2,0.7]]) does not.

How can I solve this problem?

Best,

Jan

Jan-van-Waaij commented 1 month ago

I could solve the issue by replacing line 89 "ticks = collect(minx:0.2floor((maxx - minx)/0.2/4):maxx)" by "collect(range(minx, maxx, length=5))". 0.2floor((maxx - minx)/0.2/4) is sometimes zero when maxx is close to minx.

PharmCat commented 2 weeks ago

I could solve the issue by replacing line 89 "ticks = collect(minx:0.2_floor((maxx - minx)/0.2/4):maxx)" by "collect(range(minx, maxx, length=5))". 0.2_floor((maxx - minx)/0.2/4) is sometimes zero when maxx is close to minx.

Thank you very much! It work great! :)