-
Notifications
You must be signed in to change notification settings - Fork 576
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
Plotting flat maps + plotting additional data as transparency #2658
Comments
Thx for the report ! |
Sure! Yes this is v0.7.0 and looks like their surfaces are here here is an example if hcp-utils is installed:
plot is not too stretched I think plotting one hemisphere plotting bilateral is squished: |
This is weird indeed. thank you for reporting. |
thanks! interestingly I can also reproduce it with |
Could we have a short script to work on it ? |
basically the script posted above by @jsmentch: import numpy as np
from matplotlib import pyplot as plt
import hcp_utils as hcp
from nilearn import plotting, surface
surf = surface.load_surf_mesh(hcp.mesh.flat)
plotting.plot_surf(surf)
plt.gcf().savefig("/tmp/plot-surf-hcp.png", bbox_inches="tight")
plotting.view_surf(surf).open_in_browser()
plt.close("all")
plt.scatter(surf.coordinates[::10, 1], surf.coordinates[::10, 2])
plt.gca().set_aspect(1)
plt.gcf().savefig("/tmp/scatter-nodes.png", bbox_inches="tight") you will need to |
Indeed, thx. @NicolasGensollen I think this is one for you, whenever you can. Best, |
I am plotting Cifti files with hcp-utils and nilearn. It works very nicely for the standard inflated surface but the aspect ratio is off for plotting a flatmap (squished to a square):
I'm so far unable to plot the bilateral brain flat map without this stretching happening. Is there interest in supporting plotting these flatmaps, maybe adding a keyword arg? And/or does anyone have tips on how to preserve the correct aspect ratio? I have been trying to modify the axes and fig.subplots_adjust but no luck.
Another related feature request is to be able to plot multiple stats on one surface map eg one type of data by color and another by transparency/alpha. On the above images for example, I've plotted my surf_data as normal and then blended it into the bg_map based on another map of r2score values. I could help to add this kind of functionality if it would be helpful and not complicate things too much. Thanks!
The text was updated successfully, but these errors were encountered: