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

Drawlims #279

Merged
merged 5 commits into from
Feb 23, 2023
Merged

Drawlims #279

merged 5 commits into from
Feb 23, 2023

Conversation

maximelucas
Copy link
Collaborator


# update view after drawing
padx, pady = 0.05 * w, 0.05 * h
corners = (minx - padx, miny - pady), (maxx + padx, maxy + pady)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you account for the node radius when setting the corners?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I'll change once we decide about the other comments

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update on this is that I can't figure out how to do this in a robust way since the marker size is in pixel coordinates and the rest is in data coordinates. So maybe let's not deal with this yet...

xgi/drawing/xgi_pylab.py Show resolved Hide resolved
padx, pady = 0.05 * w, 0.05 * h
corners = (minx - padx, miny - pady), (maxx + padx, maxy + pady)
ax.update_datalim(corners)
ax.autoscale_view()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an advantage to doing this vs. simply saying ax.set_xlim() and ax.set_ylim()?

Copy link
Collaborator Author

@maximelucas maximelucas Feb 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know honestly. Do you prefer to change to using set_xlim?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I prefer the set_ylim/set_xlim, because it seems a bit more explainable?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay. But the user asking the question was using set_data and not set_xlim? I was getting ready to change to set_xlim as you suggested. I don't mind which implementation we choose

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I try with the xlim/ylim syntax, I can't get it to work after all :(. So I would say to just keep it as-is.

@nwlandry
Copy link
Collaborator

I think that everything is ready to merge, since everything I suggested doesn't work consistently.

@maximelucas
Copy link
Collaborator Author

Alright, let's keep your suggestions in mind.

@maximelucas maximelucas merged commit 93ef5c3 into main Feb 23, 2023
@maximelucas maximelucas deleted the drawlims branch February 23, 2023 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants