Closed danjgale closed 3 years ago
You are changing arrayname
type from str
to bytes
when using dtype='S50'
:
# In the surfs you stored arrayname as str
print(type(surf_lh.PointData.keys()[-1])) # output: str
# And here is bytes
print(type(array_name.flat[0])) # output: numpy.bytes_
Just remove the dtype:
array_name = np.full((2, 2), fill_value=array_name[0][0])
or use unicode:
array_name = np.full((2, 2), fill_value=array_name[0][0], dtype='U50')
Yes, you are welcome to submit the PR. You could also consider how to plot the color bar, I didn't try with this layout
Ah, totally missed that array_name
uses bytes
instead of str
. I've fixed this and it works. I also added some code to handle the color bar. I figured the easies solution would be to have share = 'both'
in plot_surf
, such that the color bar can span the grid. Plotting the same Schaefer 400 parcelation:
Thank you! I'll submit a PR and we can discuss further there.
Closing this as it was resolved in #39
First off, thank you for such a great package. It has been helpful in my own studies!
I was wondering how I would go about plotting my surfaces in adifferent layout -- a 2x2 grid with the top row as lateral views and the bottom row as medial views. This is the default view in connectome workbench (see below) and it is used quite often:
I noticed that the layout in
plot_hemispheres
is hardcoded, so I've been playing with the underlying code inplot_hemispheres
with somewhat success, although I can't quite get the data to plot properly.I am using a standalone example by taking these lines from
plot_hemipsheres
and making adjustments like so:Produces:
As you can see, none of the actual data is plotted, but the layout is correct. Thoughts?
Also, if you were interested in adding this layout as an option, I would be happy to work on it and submit a PR, as I think a lot of people would find it useful!