-
Notifications
You must be signed in to change notification settings - Fork 27
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
Drawlims #279
Conversation
maximelucas
commented
Feb 15, 2023
- fixed the axlims bad axis lim in draw #278
- added existing functions to the docs (we forgot them)
|
||
# update view after drawing | ||
padx, pady = 0.05 * w, 0.05 * h | ||
corners = (minx - padx, miny - pady), (maxx + padx, maxy + pady) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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...
padx, pady = 0.05 * w, 0.05 * h | ||
corners = (minx - padx, miny - pady), (maxx + padx, maxy + pady) | ||
ax.update_datalim(corners) | ||
ax.autoscale_view() |
There was a problem hiding this comment.
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()
?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I stand corrected: https://stackoverflow.com/questions/10984085/automatically-rescale-ylim-and-xlim-in-matplotlib
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
I think that everything is ready to merge, since everything I suggested doesn't work consistently. |
Alright, let's keep your suggestions in mind. |