Skip to content

Instantly share code, notes, and snippets.

@sandeepk17
Forked from glamp/log_func.py
Created December 3, 2016 15:03
Show Gist options
  • Select an option

  • Save sandeepk17/3705033418418ce2479570141f11fa32 to your computer and use it in GitHub Desktop.

Select an option

Save sandeepk17/3705033418418ce2479570141f11fa32 to your computer and use it in GitHub Desktop.

Revisions

  1. @glamp glamp revised this gist May 9, 2016. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion log_func.py
    Original file line number Diff line number Diff line change
    @@ -9,4 +9,5 @@
    pl.xlabel("x")
    pl.ylabel("f(x) = log(x)")
    pl.legend(loc="best")
    pl.title("A Basic Log Function")
    pl.title("A Basic Log Function")
    pl.show()
  2. @glamp glamp revised this gist Jun 5, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion log_func.py
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    import pylab as pl

    x = np.random.uniform(1, 100, 1000)
    y = np.log(x) + np.random.uniform(-.5, .5, 1000)
    y = np.log(x) + np.random.normal(0, .3, 1000)

    pl.scatter(x, y, s=1, label="log(x) with noise")
    pl.plot(np.arange(1, 100), np.log(np.arange(1, 100)), c="b", label="log(x) true function")
  3. @glamp glamp created this gist Jun 5, 2013.
    12 changes: 12 additions & 0 deletions log_func.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    import numpy as np
    import pylab as pl

    x = np.random.uniform(1, 100, 1000)
    y = np.log(x) + np.random.uniform(-.5, .5, 1000)

    pl.scatter(x, y, s=1, label="log(x) with noise")
    pl.plot(np.arange(1, 100), np.log(np.arange(1, 100)), c="b", label="log(x) true function")
    pl.xlabel("x")
    pl.ylabel("f(x) = log(x)")
    pl.legend(loc="best")
    pl.title("A Basic Log Function")