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

add plotting for cartpole and mountaincar with Plots.jl #309

Conversation

jamblejoe
Copy link
Contributor

see #246

@jamblejoe
Copy link
Contributor Author

The cartpole and the mountain car look as follows. I am happy to change the appearance when necessary.

grafik

grafik

@zsunberg
Copy link
Member

I wonder if Plots.jl is the right package to do this with since it is not really a data plot. Maybe something like Compose.jl or Cairo.jl that is focused on general 2D graphics would be better (A compose mountaincar example is here: https://github.com/JuliaPOMDP/QuickPOMDPs.jl/blob/d5c51e68e1a089b1e0fe9518493b27e31cd4c1aa/examples/mountaincar_with_visualization.jl#L18-L27)

@jamblejoe
Copy link
Contributor Author

@zsunberg I agree. The previous implementation used GR but did not return a figure object to quickly do animations and it did not work out of the box with jupyter notebooks.

The PR was a fix I initially wrote for myself but was asked to create a PR. I am only familiar with Plots.jl, which is using GR as backend by default. It gets the job - animations and jupyter support - done quick and dirty.

I dont know Compose.jl or Cairo.jl.

@findmyway
Copy link
Member

I prefer to merge this first.
Rendering is not a core component in RLEnvs.jl and this PR moves one step further to drop the dependency of GR.
Different environments may have many different approaches to render environments. For example, GridWorlds.jl uses Makie, the Atari simply returns a Matrix. At least this PR gives users an option to plot the default CartPole and MountainCar environment.

@findmyway findmyway merged commit fa39728 into JuliaReinforcementLearning:master May 26, 2021
@findmyway findmyway mentioned this pull request May 26, 2021
@findmyway
Copy link
Member

@all-contributors please add @jamblejoe for code

@allcontributors
Copy link
Contributor

@findmyway

I've put up a pull request to add @jamblejoe! 🎉

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.

3 participants