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

No binding for angle and Plots does not acceptsympy.arg #415

Closed
melonedo opened this issue Apr 26, 2021 · 1 comment
Closed

No binding for angle and Plots does not acceptsympy.arg #415

melonedo opened this issue Apr 26, 2021 · 1 comment

Comments

@melonedo
Copy link

julia> angle(Sym(1))
ERROR: MethodError: no method matching angle(::Sym)
Closest candidates are:
  angle(::Real) at number.jl:188
  angle(::Complex) at complex.jl:585
Stacktrace:
 [1] top-level scope
   @ REPL[4]:1

So angle is not supported, I should try sympy.arg

julia> sympy.arg(Sym(im))
π
─
2
julia> plot(sympy.arg(Sym("t")))
ERROR: #91 is not a Function, or is not defined at any of the values [-5.0, -1.0, 0.0, 0.01]
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:33
  [2] tryrange(F::SymPy.var"#91#92"{SymPy.var"###257"}, vec::Vector{Float64})
    @ PlotUtils C:\Users\melonedo\.julia\packages\PlotUtils\es5pb\src\adapted_grid.jl:180
  [3] macro expansion
    @ C:\Users\melonedo\.julia\packages\RecipesPipeline\CirY4\src\user_recipe.jl:252 [inlined]
  [4] apply_recipe(plotattributes::AbstractDict{Symbol, Any}, f::SymPy.var"#91#92"{SymPy.var"###257"})
    @ RecipesPipeline C:\Users\melonedo\.julia\packages\RecipesBase\92zOw\src\RecipesBase.jl:282
  [5] _process_userrecipes!(plt::Any, plotattributes::Any, args::Any)
    @ RecipesPipeline C:\Users\melonedo\.julia\packages\RecipesPipeline\CirY4\src\user_recipe.jl:36
  [6] recipe_pipeline!(plt::Any, plotattributes::Any, args::Any)
    @ RecipesPipeline C:\Users\melonedo\.julia\packages\RecipesPipeline\CirY4\src\RecipesPipeline.jl:70
  [7] _plot!(plt::Plots.Plot, plotattributes::Any, args::Any)
    @ Plots C:\Users\melonedo\.julia\packages\Plots\kyYZF\src\plot.jl:172
  [8] plot(args::Any; kw::Any)
    @ Plots C:\Users\melonedo\.julia\packages\Plots\kyYZF\src\plot.jl:58
  [9] plot(args::Any)
    @ Plots C:\Users\melonedo\.julia\packages\Plots\kyYZF\src\plot.jl:52
 [10] top-level scope
    @ REPL[14]:1

caused by: BoundsError: attempt to access 0-element Vector{Plots.Subplot} at index [1]
Stacktrace:
  [1] getindex
    @ .\array.jl:801 [inlined]
  [2] getindex
    @ C:\Users\melonedo\.julia\packages\Plots\kyYZF\src\types.jl:88 [inlined]
  [3] get_axis_limits(plt::Plots.Plot{Plots.GRBackend}, letter::Symbol)
    @ Plots C:\Users\melonedo\.julia\packages\Plots\kyYZF\src\pipeline.jl:144
  [4] macro expansion
    @ C:\Users\melonedo\.julia\packages\RecipesPipeline\CirY4\src\user_recipe.jl:249 [inlined]
  [5] apply_recipe(plotattributes::AbstractDict{Symbol, Any}, f::SymPy.var"#91#92"{SymPy.var"###257"})
    @ RecipesPipeline C:\Users\melonedo\.julia\packages\RecipesBase\92zOw\src\RecipesBase.jl:282
  [6] _process_userrecipes!(plt::Any, plotattributes::Any, args::Any)
    @ RecipesPipeline C:\Users\melonedo\.julia\packages\RecipesPipeline\CirY4\src\user_recipe.jl:36
  [7] recipe_pipeline!(plt::Any, plotattributes::Any, args::Any)
    @ RecipesPipeline C:\Users\melonedo\.julia\packages\RecipesPipeline\CirY4\src\RecipesPipeline.jl:70
  [8] _plot!(plt::Plots.Plot, plotattributes::Any, args::Any)
    @ Plots C:\Users\melonedo\.julia\packages\Plots\kyYZF\src\plot.jl:172
  [9] plot(args::Any; kw::Any)
    @ Plots C:\Users\melonedo\.julia\packages\Plots\kyYZF\src\plot.jl:58
 [10] plot(args::Any)
    @ Plots C:\Users\melonedo\.julia\packages\Plots\kyYZF\src\plot.jl:52
 [11] top-level scope
    @ REPL[14]:1

Then it seems it is impossible to make a phase angle plot on sympy objects.

jverzani added a commit to jverzani/SymPy.jl that referenced this issue Apr 26, 2021
@jverzani
Copy link
Collaborator

Thanks for the report!

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

No branches or pull requests

2 participants