Questions tagged [loglog]

65 questions
59
votes
6 answers

LogLog and HyperLogLog algorithms for counting of large cardinalities

Where can I find a valid implementation of LogLog algorithm? Have tried to implement it by myself but my draft implementation yields strange results. Here it is: function LogLog(max_error, max_count) { function log2(x) { return…
actual
  • 2,370
  • 1
  • 21
  • 32
19
votes
1 answer

log-log plot with seaborn jointgrid

I'm trying to create a loglog plot with a KDE and histogram associated with each axis using a seaborn JointGrid object. This gets me pretty close, but the histogram bins do not translate well into logspace. Is there a way to do this easily without…
Koppology
  • 262
  • 1
  • 2
  • 6
9
votes
4 answers

Setting both axes logarithmic in bar plot matploblib

I have already binned data to plot a histogram. For this reason I'm using the plt.bar() function. I'd like to set both axes in the plot to a logarithmic scale. If I set plt.bar(x, y, width=10, color='b', log=True) which lets me set the y-axis to…
aces
  • 185
  • 1
  • 1
  • 10
6
votes
3 answers

Fitting a straight line to a log-log curve

I have a plot with me which is logarithmic on both the axes. I have pyplot's loglog function to do this. It also gives me the logarithmic scale on both the axes. Now, using numpy I fit a straight line to the set of points that I have. However, when…
Rohit Shinde
  • 1,575
  • 5
  • 21
  • 47
3
votes
0 answers

Set log plot limits to next lowest/highest decade

I've got a function that creates a log-log plot using Matplotlib. import matplotlib.pyplot as plt plt.loglog(xdata, ydata, label="function label...") # ...more plots plt.set_xlabel("Frequency (Hz)") plt.show() I'd like to have Matplotlib plot one…
Sean
  • 1,346
  • 13
  • 24
3
votes
0 answers

linear (log-log) model with 'lm': how to get prediction variance of sum of predicted values

I'm fitting a power model to a dataset by applying a simple linear model with the R function lm after log-log transformation, as in the example below (instead of fitting directly the power model, for example by applying the nls function). I could…
Marco
  • 31
  • 3
3
votes
1 answer

Interpolating a straight line on a log-log graph (NumPy)

I’m using a program on a Raspberry Pi that measures the voltage across a probe within salt water to calculate the salinity of the water. The relationship is not linear but becomes a fairly straight line when a power trend line is plotted on a…
Morthwyl
  • 31
  • 1
  • 3
3
votes
2 answers

Python: Plotting errorbars in a loglog scale, in a loop and then saving the image

I have 58 files that I need to plot. Some of them are empty (not important, I already skipped them with the if condition). I need to plot the data in the files, using a loglog scale, with error bars. And I want to save the plots in the end. I am…
user1939144
  • 31
  • 1
  • 4
3
votes
1 answer

Python: how to compute the Euclidean distance distribution of a regular network?

I have an NxN regular network, each node of which has an (X,Y) set of coordinates. The nodes are separated by the unit. The network looks like this: (0,0) (1,0) (2,0) (0,1) (1,1) (2,1) (0,2) (1,2) (2,2) I want to be able to compute the Euclidean…
FaCoffee
  • 7,609
  • 28
  • 99
  • 174
3
votes
1 answer

Python - matplotlib modify xticks for a "loglog" plot

I am plotting in log scale for each axis, but I don't want scientific notation for the x axis, so I modified it as follows: from matplotlib import pyplot as plt from matplotlib.ticker import FormatStrFormatter a = np.array([10.**(-2), 10.**(-3),…
user3601754
  • 3,792
  • 11
  • 43
  • 77
2
votes
2 answers

Gnuplot smoothing data in loglog plot

I would like to plot a smoothed curve based on a dataset which spans over 13 orders of magnitude [1E-9:1E4] in x and 4 orders of magnitude [1E-6:1e-2] in y. MWE: set log x set log y set xrange [1E-9:1E4] set yrange [1E-6:1e-2] set samples 1000 plot…
Dolan
  • 41
  • 3
2
votes
0 answers

Why scipy curve_fit to a power law in a log log scale gives a wrong fit?

I am trying to fit a power law to some data following a power law with noise, displayed in a log-log scale: The fit with scipy curve_fit is the orange line and the red line is the noiseless power law. Here is the code: import numpy as np import…
Puco4
  • 491
  • 5
  • 16
2
votes
1 answer

errorbar not behaving in loglog plot

I have these arrays temperature = np.array([28.999795, 30.999707, 32.999471, 34.999571, 36.999753, 50.99875, 51.998767, 52.998236, 53.99675]) rate = np.array([ 8.08506648, 10.44422144, 13.77091141, 18.19601143, 24.96162138, 2538.75705877,…
dani reta
  • 69
  • 8
2
votes
1 answer

Wrong Y-intercept for best fit line of loglog plot

I've tried the solutions from many guides to plot the best fit line for my loglog plot but I keep getting a line that appears to have the correct slope but a y-intercept that is way too large. The graph is plotted in the last chunk of code. Example…
Apple
  • 103
  • 1
  • 10
2
votes
2 answers

Plotting a dashed line on a log-log plot using Python's matplotlib

I'm currently trying to place a horizontal dashed line through my log-log graph using the below code. K2H_HUBp[:,1] and DivR are two [1x6000] arrays. The variable ones is a [1x6000] array full of ones. The point of this plot is showing how the…
Jake Clark
  • 29
  • 1
  • 4
1
2 3 4 5