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 example of visualizing PropertyLayers to example models #2580

Open
EwoutH opened this issue Dec 30, 2024 · 4 comments
Open

Add example of visualizing PropertyLayers to example models #2580

EwoutH opened this issue Dec 30, 2024 · 4 comments
Labels
example Changes the examples or adds to them.

Comments

@EwoutH
Copy link
Member

EwoutH commented Dec 30, 2024

Currently none of the Example models visualize the PropertyLayers, it would be useful if at least one of them did. This could be Sugarscape Constant Growback Model with Traders for example.

See:

@EwoutH EwoutH added the example Changes the examples or adds to them. label Dec 30, 2024
@quaquel
Copy link
Member

quaquel commented Dec 30, 2024

I looked at the sugarscape example, and the current portrayal of property layers is not compatible with what would be required for sugarscape. The issue is that currently the entire layer is shown, and you cannot mask part of the layer as done in sugarscape.

@EwoutH
Copy link
Member Author

EwoutH commented Dec 30, 2024

Can you set alpha to 0 for certain values you want to hide?

@quaquel
Copy link
Member

quaquel commented Dec 30, 2024

alpha is applied to the entire layer

@EwoutH
Copy link
Member Author

EwoutH commented Dec 30, 2024

It seems I did allow scaling over alpha instead of color in the implementation (#2336): 7c8e98b

Any matplotlib color is valid. The highest value will have that color with 0% opacity, the lowest with 100% opacity (which can again be scaled with modifying vmin and vmax).

That should work if you define a "color" instead of a "colormap" in the propertylayer_portrayal dict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example Changes the examples or adds to them.
Projects
None yet
Development

No branches or pull requests

2 participants