-
Notifications
You must be signed in to change notification settings - Fork 34
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
Drawing looks weird now... #654
Comments
I believe that PR #575 created this issue. @maximelucas any ideas? |
Hmm yea I added the edgecolor parameter back, and I think it's got to do with its default value. |
@maximelucas if I run this code, I still get those weird lines: import xgi
plt.figure(figsize=(1, 1))
H = xgi.Hypergraph([[1, 2, 3]])
xgi.draw(
H,
node_size=5,
hull=True,
radius=0.15,
)
plt.savefig("test.png", dpi=1000) (Fig size is (1, 1) so you can see the lines better) If I set |
Thanks. Ok I know what is happening. By default, Possible solution: we add an What do you think? |
That could work! But that still doesn't fix the issue where the line is not at the border of the edge (see picture in my first post). Any idea how to fix that? |
Aah I didn't get that was the problem. Okay, so it seems to be due to the transparency: With But with the default So the "edge" we see is actually where the actual edge and the face overlap. It's the same with I'm not sure what solution we could find for that, other than maybe finding a way to not apply transparency to the edge's edge? But that doesn't sound ideal. In most cases, I'd say setting |
I tested it out, and I'm pretty sure that setting |
Thanks for the insight on this. TBH, I am not sure why we would want to have the default be transparent. I suppose that if there is no facecolor, then we won't see these weird overlapping patterns. |
That's because that parameter doesn't exist yet :)
The transparency is for the full patch (=hyperedge), we have always had it by default because in many cases many hyperedges visually overlap. If you think it could look good without transparency we could test a few cases and see.
Exactly. To summarise, by adding the
|
Gotcha. That sounds great! Is there any way to control the alpha of the border vs. alpha of the edge? |
I don't think matplotlib allows that in any simple way. The call to plot the hyperedges uses edge_collection = PatchCollection(
patches,
facecolors=edge_fc_colors,
array=edge_fc_arr, # will be mapped by PatchCollection
cmap=edge_fc_cmap,
edgecolors=edge_ec,
alpha=alpha,
zorder=max_order - 2, # below dyads
linewidth=edge_lw,
) which has a single |
This is using the standard
xgi.draw
and this is an example of what I get out:The text was updated successfully, but these errors were encountered: