With the excellent matplotlib
and numpy
packages
from matplotlib import pyplot as mp import numpy as np def gaussian(x, mu, sig): return np.exp(-np.power(x - mu, 2.) / (2 * np.power(sig, 2.))) x_values = np.linspace(-3, 3, 120) for mu, sig in [(-1, 1), (0, 2), (2, 3)]: mp.plot(x_values, gaussian(x_values, mu, sig)) mp.show()
will produce something like
Related Posts:
- How do you change the size of figures drawn with Matplotlib?
- matplotlib savefig() plots different from show()
- Save plot to image file instead of displaying it using Matplotlib
- How do you change the size of figures drawn with Matplotlib?
- Matplotlib automatic legend outside plot
- Matplotlib automatic legend outside plot
- Changing the “tick frequency” on x or y axis in matplotlib?
- How to add title to subplots in Matplotlib
- Create own colormap using matplotlib and plot color scale
- How to make a 3D scatter plot in matplotlib
- Modify the legend of pandas bar plot
- Changing the “tick frequency” on x or y axis in matplotlib
- Remove xticks in a matplotlib plot?
- Gaussian fit for Python
- Scatter plot colorbar – Matplotlib
- Install Plotly in Anaconda
- Plotting multiple lines, in different colors, with pandas dataframe
- Why do many examples use `fig, ax = plt.subplots()` in Matplotlib/pyplot/python
- How do I tell Matplotlib to create a second (new) plot, then later plot on the old one?
- KeyError: ‘plotly_domain’
- Transpose/Unzip Function (inverse of zip)?
- TypeError: unhashable type: ‘numpy.ndarray’
- python base64 to hex
- What’s the canonical way to check for type in Python?
- IndexError: tuple index out of range —– Python
- What is the pythonic way to calculate dot product?
- How to resize an image with OpenCV2.0 and Python2.6
- Is there a ‘foreach’ function in Python 3?
- How to condense if/else into one line in Python?
- Depth-first search (DFS) code in python
- How to use Python to execute a cURL command?
- ‘builtin_function_or_method’ object is not iterable
- Why KeyError: 0
- bash: pip: command not found
- How do I concatenate two lists in Python?
- Convert a tensor to numpy array in Tensorflow?
- How to run Conda?
- How do I check whether a file exists without exceptions?
- How can I get dictionary key as variable directly in Python (not by searching from value)?
- pygame.error: video system not initialized
- Python – Reading and writing csv files with utf-8 encoding
- Python’s equivalent of && (logical-and) in an if-statement
- Replace values in list using Python
- Remove all occurrences of a value from a list?
- os.path.dirname(__file__) returns empty
- keyerror 1 in my code
- ‘NoneType’ object has no attribute ‘group’
- How to fix ‘ValueError: list.remove(x): x not in list’ error in Python
- Group by index + column in pandas
- What is the difference between ‘/’ and ‘//’ when used for division?
- How do I format a string using a dictionary in python-3.x?
- How to extend a class in python?
- Converting XML to JSON using Python?
- Django – no such table exception
- How to import a module given the full path?
- Why does “pip install” inside Python raise a SyntaxError?
- Removing numbers from string
- importing external “.txt” file in python
- How can I remove Nan from list Python/NumPy
- Writing string to a file on a new line every time
- examining items in a python Queue
- What’s the difference between scikit-learn and tensorflow? Is it possible to use them together?
- How to initialize weights in PyTorch?
- Can’t find module cPickle using Python 3.5 and Anaconda
- How can I check if two segments intersect?
- “Can’t convert ‘float’ object to str implicitly”
- Why I get ‘list’ object has no attribute ‘items’?
- tar: Unrecognized archive format error when trying to unpack flower_photos.tgz, TF tutorials on OSX
- Repeating a function in Python
- Python Requests – No connection adapters
- WindowsError: [Error 126] The specified module could not be found
- No module named ‘openpyxl’ – Python 3.4 – Ubuntu
- How to easily print ascii-art text?
- Using Tkinter in python to edit the title bar
- LinAlgError: Last 2 dimensions of the array must be square
- Nonlinear regression with python – what’s a simple method to fit this data better?
- ImportError: No module named mysql.connector using Python2
- datetime to string with series in pandas
- Is it possible only to declare a variable without assigning any value in Python?
- How to Install pip for python 3.7 on Ubuntu 18?
- How to add a new row to an empty numpy array
- Printing one character at a time from a string, using the while loop
- Change the name of a key in dictionary
- Check if an object exists
- How do I calculate the date six months from the current date using the datetime Python module?
- How to embed image or picture in jupyter notebook, either from a local machine or from a web resource?
- How to make a python script wait for a pressed key?
- TypeError: Image data can not convert to float
- Mean Squared Error in Numpy?
- Turn a single number into single digits Python
- Logical operators for Boolean indexing in Pandas
- Transposing a 1D NumPy array
- Explaining Python’s ‘__enter__’ and ‘__exit__’
- numpy.float64 object is not iterable…but I’m NOT trying to
- Converting a list to a set changes element order
- Create a list with initial capacity in Python
- Accessing dict_keys element by index in Python3
- How to update Pandas from Anaconda and is it possible to use eclipse with this last
- Does python support character type?
- Styling multi-line conditions in ‘if’ statements?