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

original data option for the power law plot #41

Open
BMo-design opened this issue Apr 5, 2017 · 6 comments
Open

original data option for the power law plot #41

BMo-design opened this issue Apr 5, 2017 · 6 comments

Comments

@BMo-design
Copy link

BMo-design commented Apr 5, 2017

Hi,

when I activate the original data option the plot of my sample changes but not the power law fit. I guess that is an issue, or?

Here a plots of my sample without the original data option:
testsingle_1
With the original data option:
testsingle_originaldata_1

Here is my code:

       ax = fits[1].plot_ccdf()
	fits[1].power_law.plot_ccdf(ax=ax, color='r', linestyle='--', linewidth=1, label='Power law fit')#add powerlaw line
	plt.savefig("testsingle_{}.png".format(1))
	plt.close()

ax=fits[1].plot_ccdf(original_data = True)
	fits[1].power_law.plot_ccdf(ax=ax, color='r', linestyle='--', linewidth=1, label='Power law fit')#add powerlaw line
	plt.savefig("testsingle_originaldata_{}.png".format(1))
	plt.close()
@BMo-design
Copy link
Author

Comparing the results of this library with the results of the script by Joel Ornstein http://tuvalu.santafe.edu/~aaronc/powerlaws/, I found that the blue line in the second figure is correct, but the fit (red line) should be at the same position as in the first picture....

@jeffalstott
Copy link
Owner

I don't understand the issue. Can you be more detailed in what you're expecting to happen, and how this is different from what you're seeing?

@BMo-design
Copy link
Author

BMo-design commented Apr 5, 2017

Hi Jeff,
thanks for your answer. I would expect a figure like this:
plot0

@jeffalstott
Copy link
Owner

What you're talking about was discussed here:
https://groups.google.com/d/msg/powerlaw-general/A3aI-5efAuE/wpp6EGZut7gJ

@psinger implemented a proportionality constant ("shifting") capability in his fork here, but it didn't materialize into a fully-vetted pull request to merge into powerlaw. If you implement the functionality you want and make a pull request, I'll merge it in!

"powerlaw is open for further development. If there's a feature you'd like to see in powerlaw, submit an issue. Pull requests and offers for expansion or inclusion in other projects are welcomed and encouraged. The original author of powerlaw, Jeff Alstott, is now only writing minor tweaks, so contributions are very helpful."

@pyguy3
Copy link

pyguy3 commented Dec 21, 2020

Just to say I would also find this feature useful, i.e. it would be great to be able to see the power law fit superimposed on the full dataset, not just the dataset starting at xmin. That way, it is easy to do a visual check on whether the xmin used is sensible.

@jeffalstott
Copy link
Owner

Thanks @pyguy3. As I mentioned back in 2017, if a fully-vetted pull request is made, I'll merge it in! @psinger got one started in his fork here.

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

No branches or pull requests

3 participants