-
Notifications
You must be signed in to change notification settings - Fork 926
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
solara_viz: Add borders around ContinuousSpace #1988
Conversation
Performance benchmarks:
|
This line is the cause:
|
Use a 'loosely dashed' line for torus=True See https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html
Performance benchmarks:
|
While I think these are good defaults, maybe we should allow passing the background color and turning the borders on or off. |
I started looking at the current code last week when I ran into the bug fixed this morning via #1984. I want to return to this at some point in the next few weeks. I see two options
In the long run, I believe that the second option is much more flexible and easier to use. For example, in my exam model, I want to plot a background 2d KDE and have my agents on top of this. It is impossible to do this via (1) but easy to support via (2). In fact, I would only need to plot the KDE once in the init and only have to update the location of the agents while running the model. |
The dotted/solid line SGTM. The background grey color is debatable, but if you must provide a background color:
|
Shall I do only the line for now in this PR? And then we can discuss the other stuff later? |
SGTM |
See also #1797. I checked that Seaborn doesn't have its own
See also #885. The solution in this issue is blocked from being merged because we are considering of migrating to Altair instead of Matplotlib. However, we should implement both Matplotlib and Altair viz in parallel: #1849 (reply in thread), and to make sure they have as similar API as possible. |
So 2.2.3 would include the view limits and this? It would be nice for teaching and the exam if it all works. I will still make the exam to also work on older versions because students... |
* solara_viz: Add grey background and borders * solara_viz: Render axis * solara_viz: Better dash Use a 'loosely dashed' line for torus=True See https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html * solara_viz: Remove background color
Ever got a release from an open-source release custom made for you, within a day? There you go!
Just add at the top of the notebook: import mesa
if mesa.__version__ != "2.2.3"
%pip install -U mesa==2.2.3 |
For all intents and purposes, this should work. However, on my systems, I can't get it to visualise
It should looks something like this:
But in reality, on my system, it keeps looking like this:
I can add a title for some reason, but can't add borders or a background color.
Could it be that the background color and spines are overwritten later? @rht @quaquel @ankitk50, if one of you can explain or find the source of this madness, please.