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

Draw bug #936

Merged
merged 2 commits into from
Aug 16, 2013
Merged

Draw bug #936

merged 2 commits into from
Aug 16, 2013

Conversation

tacaswell
Copy link
Contributor

The documentation claims that node labels are not drawn. Modified the plotting code so this is actually true.

@ghost ghost assigned hagberg Aug 16, 2013
hagberg added a commit that referenced this pull request Aug 16, 2013
@hagberg hagberg merged commit eaa0c34 into networkx:master Aug 16, 2013
@tacaswell
Copy link
Contributor Author

@hagberg This broke back-compatibility with out documentation (see http://stackoverflow.com/questions/25865975/pylab-networkx-no-node-labels-displayed-after-update).

What do you want me to do to fix it?

@tacaswell
Copy link
Contributor Author

Actually reading back into this a bit more, I seems that this brought the behaviour in line with the documentation, not the other way around.

@chebee7i
Copy link
Member

Maybe it should be extended so that if labels is a kwarg, then with_labels is automatically set to True? This seems more in line with what the user actually intends---as there is never a time when it is useful to pass in labels and have with_labels be False. When labels is None, then if the user wants the "default" labels, then they must explicitly pass with_labels=True (this is the current situation and should remain).

@tacaswell
Copy link
Contributor Author

Something like

if 'with_labels' not in kwds:
   kwds['with_labels'] = 'labels' in kwds

which will never over-ride explicit user input, but will add the labels if they are explicitly passed in?

@tacaswell
Copy link
Contributor Author

And I can image cases where you would want to pass in both labels and with_labels=False if you are using draw in a higher level function that adds custom labels, but still makes it possible to toggle drawing them with a flag.

@chebee7i
Copy link
Member

Ah yes, I suppose that is true. You might not remove it from kwargs and so you want some way of turning it off. What you proposed sounds good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants