Skip to content

Commit

Permalink
Switch to svg files
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelOwenDyer committed Apr 10, 2024
1 parent 52719b4 commit f656d82
Show file tree
Hide file tree
Showing 21 changed files with 10,759 additions and 15 deletions.
Binary file removed rand_distr/plots/binomial.png
Binary file not shown.
1,427 changes: 1,427 additions & 0 deletions rand_distr/plots/binomial.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed rand_distr/plots/cauchy.png
Binary file not shown.
1,390 changes: 1,390 additions & 0 deletions rand_distr/plots/cauchy.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed rand_distr/plots/chi_squared.png
Binary file not shown.
1,336 changes: 1,336 additions & 0 deletions rand_distr/plots/chi_squared.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed rand_distr/plots/exponential.png
Binary file not shown.
1,112 changes: 1,112 additions & 0 deletions rand_distr/plots/exponential.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed rand_distr/plots/gamma.png
Binary file not shown.
1,453 changes: 1,453 additions & 0 deletions rand_distr/plots/gamma.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed rand_distr/plots/normal.png
Binary file not shown.
1,432 changes: 1,432 additions & 0 deletions rand_distr/plots/normal.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed rand_distr/plots/poisson.png
Binary file not shown.
1,473 changes: 1,473 additions & 0 deletions rand_distr/plots/poisson.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 11 additions & 7 deletions rand_distr/plots/py/main.py
Expand Up @@ -3,23 +3,27 @@


OUT = "target"
EXT = "png"
EXT = "svg"


def standard_normal():
from scipy.stats import norm
# Defining the standard normal distribution PDF
def y(x):
from scipy.stats import norm
return norm.pdf(x)

# Possible values for the distribution
x = np.linspace(-3, 3, 1000)
x = np.linspace(-5, 5, 1000)

# Creating the figure and the axis
fig, ax = plt.subplots()

# Plotting the PDF for the standard normal distribution
ax.plot(x, norm.pdf(x), label='Standard normal')
ax.plot(x, y(x), label=f'μ = 0, σ = 1')

# Adding title and labels
ax.set_title('Standard normal distribution')
ax.set_xlabel('Z-score (standard deviations from the mean)')
ax.set_xlabel('x')
ax.set_ylabel('Probability density')

# Adding a legend
Expand Down Expand Up @@ -331,8 +335,8 @@ def y(alpha, x):


if __name__ == "__main__":
# standard_normal()
normal()
standard_normal()
# normal()
# chi_squared()
# binomial()
# cauchy()
Expand Down

0 comments on commit f656d82

Please sign in to comment.