Skip to content

Conversation

@ufechner7
Copy link
Member

@ufechner7 ufechner7 commented Feb 17, 2025

  • set_plot_style
  • save_plot
  • show_plot
  • plot_line_segment!
  • set_axes_equal!
  • create_geometry_plot
  • plot_distribution
  • generate_polar_data
  • plot_polars

@ufechner7
Copy link
Member Author

Fixes #3

@1-Bart-1 1-Bart-1 linked an issue Feb 17, 2025 that may be closed by this pull request
@ufechner7 ufechner7 changed the title replace Plots with ControlPlots step one replace Plots with ControlPlots Feb 17, 2025
@codecov
Copy link

codecov bot commented Feb 18, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@ufechner7 ufechner7 marked this pull request as ready for review February 19, 2025 16:58
@ufechner7 ufechner7 requested a review from 1-Bart-1 February 19, 2025 16:58
Copy link
Member

@1-Bart-1 1-Bart-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work! The plot looks very nice.

@1-Bart-1
Copy link
Member

I am getting an error when running examples/rectangular_wing.jl

ERROR: LoadError: PyError ($(Expr(:escape, :(ccall(#= /home/bart/.julia/packages/PyCall/1gn3u/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'TypeError'>
TypeError("object of type 'PyCall.jlwrap' has no len()")
  File "/home/bart/.venv/lib/python3.12/site-packages/matplotlib/axes/_axes.py", line 337, in legend
    self.legend_ = mlegend.Legend(self, handles, labels, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bart/.venv/lib/python3.12/site-packages/matplotlib/legend.py", line 462, in __init__
    if len(handles) < 2:
       ^^^^^^^^^^^^

Stacktrace:
  [1] pyerr_check
    @ ~/.julia/packages/PyCall/1gn3u/src/exception.jl:75 [inlined]
  [2] pyerr_check
    @ ~/.julia/packages/PyCall/1gn3u/src/exception.jl:79 [inlined]
  [3] _handle_error(msg::String)
    @ PyCall ~/.julia/packages/PyCall/1gn3u/src/exception.jl:96
  [4] macro expansion
    @ ~/.julia/packages/PyCall/1gn3u/src/exception.jl:110 [inlined]
  [5] #107
    @ ~/.julia/packages/PyCall/1gn3u/src/pyfncall.jl:43 [inlined]
  [6] disable_sigint
    @ ./c.jl:473 [inlined]
  [7] __pycall!
    @ ~/.julia/packages/PyCall/1gn3u/src/pyfncall.jl:42 [inlined]
  [8] _pycall!(ret::PyCall.PyObject, o::PyCall.PyObject, args::Tuple{Base.ValueIterator{Dict{…}}, Base.KeySet{String, Dict{…}}}, nargs::Int64, kw::PyCall.PyObject)
    @ PyCall ~/.julia/packages/PyCall/1gn3u/src/pyfncall.jl:29
  [9] _pycall!(ret::PyCall.PyObject, o::PyCall.PyObject, args::Tuple{Base.ValueIterator{…}, Base.KeySet{…}}, kwargs::@Kwargs{bbox_to_anchor::Tuple{…}})
    @ PyCall ~/.julia/packages/PyCall/1gn3u/src/pyfncall.jl:11
 [10] (::PyCall.PyObject)(::Base.ValueIterator{Dict{String, PyCall.PyObject}}, ::Vararg{Any}; kwargs::@Kwargs{bbox_to_anchor::Tuple{Int64, Int64, Float64, Int64}})
    @ PyCall ~/.julia/packages/PyCall/1gn3u/src/pyfncall.jl:86
 [11] create_geometry_plot(wing_aero::WingAerodynamics, title::String, view_elevation::Int64, view_azimuth::Int64; zoom::Float64)
    @ VortexStepMethod ~/Code/VortexStepMethod.jl/src/plotting.jl:181
 [12] create_geometry_plot
    @ ~/Code/VortexStepMethod.jl/src/plotting.jl:116 [inlined]
 [13] plot_geometry(wing_aero::WingAerodynamics, title::String; data_type::String, save_path::String, is_save::Bool, is_show::Bool, view_elevation::Int64, view_azimuth::Int64)
    @ VortexStepMethod ~/Code/VortexStepMethod.jl/src/plotting.jl:233
 [14] top-level scope
    @ ~/Code/VortexStepMethod.jl/examples/rectangular_wing.jl:56
 [15] include(fname::String)
    @ Base.MainInclude ./client.jl:494
 [16] top-level scope
    @ REPL[1]:1
in expression starting at /home/bart/Code/VortexStepMethod.jl/examples/rectangular_wing.jl:56
Some type information was truncated. Use `show(err)` to see complete types.

@1-Bart-1 1-Bart-1 self-requested a review February 19, 2025 17:23
@1-Bart-1
Copy link
Member

1-Bart-1 commented Feb 19, 2025

Please make sure examples/testing_stall_model.jl runs without error as well. And maybe rename testing_stall_model.jl to just stall_model.jl as it isn't a test but an example.

@ufechner7
Copy link
Member Author

ufechner7 commented Feb 19, 2025

Well, examples/rectangular_wing.jl works fine on my machine.
Did you do:

Pkg.update()

after switching the branch?

Furthermore, if you use Ubuntu please do not use any virtual Python environment. Instead, execute sudo apt install python3-matplotlib before starting Julia with ./bin/run_julia

@1-Bart-1
Copy link
Member

The easiest way to actually deactivate a virtual environment on python was to delete it... But it works now!

@1-Bart-1 1-Bart-1 merged commit 735c136 into main Feb 19, 2025
3 checks passed
@1-Bart-1 1-Bart-1 deleted the controlplots branch March 22, 2025 10:57
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

Successfully merging this pull request may close these issues.

Replace Plots.jl with ControlPlots.jl

3 participants