You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So this is understandable, and most def not your doing, but currently despite the fact that we can do all of this with BigFloats for crazy accuracy, we can not plot the results. So either mention this in the docs, show a workaround, include a method that fixes this, or change the plotting to something that does (I doubt this exists, but maybe Makie?).
plot(big.(rand(10))) works in PyPlot, so I don't see a reason that plotting shouldn't work. I'll look at this more once you've pasted the code that lead to the issue.
Oh, sorry, I assumed this was a known problem. Here is the code:
julia>using DynamicalBilliards
julia>using PyPlot
WARNING:using PyPlot.axes inmodule Main conflicts with an existing identifier.
julia> bd =billiard_rectangle(BigFloat(2),BigFloat(2))
Billiard{BigFloat} with 4 obstacles:
Bottom wall
Right wall
Top wall
Left wall
julia>plot(bd)
ERROR: PyError ($(Expr(:escape, :(ccall(#= /home/yakir/.julia/packages/PyCall/0jMpb/src/pyfncall.jl:44 =#@pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'TypeError'>TypeError("ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''",)
File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 1605, in xlim
ret = ax.set_xlim(*args, **kwargs)
File "/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 2904, in set_xlim
left, right = mtransforms.nonsingular(left, right, increasing=False)
File "/usr/lib/python3/dist-packages/matplotlib/transforms.py", line 2773, in nonsingular
if (not np.isfinite(vmin)) or (not np.isfinite(vmax)):
Stacktrace:
[1] pyerr_check at /home/yakir/.julia/packages/PyCall/0jMpb/src/exception.jl:60 [inlined]
[2] pyerr_check at /home/yakir/.julia/packages/PyCall/0jMpb/src/exception.jl:64 [inlined]
[3] macro expansion at /home/yakir/.julia/packages/PyCall/0jMpb/src/exception.jl:84 [inlined]
[4] __pycall!(::PyCall.PyObject, ::Ptr{PyCall.PyObject_struct}, ::PyCall.PyObject, ::Ptr{Nothing}) at /home/yakir/.julia/packages/PyCall/0jMpb/src/pyfncall.jl:44
[5] _pycall!(::PyCall.PyObject, ::PyCall.PyObject, ::Tuple{BigFloat,BigFloat}, ::Int64, ::Ptr{Nothing}) at /home/yakir/.julia/packages/PyCall/0jMpb/src/pyfncall.jl:22
[6] _pycall!(::PyCall.PyObject, ::PyCall.PyObject, ::Tuple{BigFloat,BigFloat}, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/yakir/.julia/packages/PyCall/0jMpb/src/pyfncall.jl:11
[7] #pycall#88(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::PyCall.PyObject, ::Type{PyCall.PyAny}, ::BigFloat, ::Vararg{BigFloat,N} where N) at /home/yakir/.julia/packages/PyCall/0jMpb/src/pyfncall.jl:86
[8] pycall(::PyCall.PyObject, ::Type{PyCall.PyAny}, ::BigFloat, ::Vararg{BigFloat,N}where N) at /home/yakir/.julia/packages/PyCall/0jMpb/src/pyfncall.jl:86
[9] #xlim#137(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::BigFloat, ::Vararg{BigFloat,N} where N) at /home/yakir/.julia/packages/PyPlot/fZuOQ/src/PyPlot.jl:179
[10] xlim at /home/yakir/.julia/packages/PyPlot/fZuOQ/src/PyPlot.jl:176 [inlined]
[11] #plot#85(::PyCall.PyObject, ::Function, ::Billiard{BigFloat,4,NTuple{4,InfiniteWall{BigFloat}},Nothing}) at /home/yakir/.julia/packages/DynamicalBilliards/pQCBP/src/plotting/billiards.jl:46
[12] plot(::Billiard{BigFloat,4,NTuple{4,InfiniteWall{BigFloat}},Nothing}) at /home/yakir/.julia/packages/DynamicalBilliards/pQCBP/src/plotting/billiards.jl:39
[13] top-level scope at none:0
So since we will be almost certainly porting plotting of this package to Makie I won't be spending time solving this. But I'll keep it open for reference, to be sure that this is tested when we go to makie!
Activity
Datseris commentedon Nov 5, 2018
It is always helpful to post the code that lead to this issue, and maybe even the error message :)
Datseris commentedon Nov 5, 2018
plot(big.(rand(10)))works in PyPlot, so I don't see a reason that plotting shouldn't work. I'll look at this more once you've pasted the code that lead to the issue.yakir12 commentedon Nov 6, 2018
Oh, sorry, I assumed this was a known problem. Here is the code:
Datseris commentedon Nov 8, 2018
So since we will be almost certainly porting plotting of this package to Makie I won't be spending time solving this. But I'll keep it open for reference, to be sure that this is tested when we go to makie!
asinghvi17 commentedon Aug 2, 2019
Makie converts internally to Float32, so BigFloats won't be as useful there. Still, it is possible.