Snippets tagged “matplotlib”
15 snippets use this tag.
- Adding a legend to PyPlot in Matplotlib in the simplest manner possiblePython
Here is a simple code snippet that demonstrates how to add a legend to a PyPlot in Matplotlib:
- Changing the tick frequency on the x or y axisPython
In matplotlib, you can change the tick frequency on the x or y axis of a plot by using the set_xticks() or set_yticks() method of the Axes class.
- How do I change the size of figures drawn with Matplotlib?Python
To change the size of figures drawn with Matplotlib in Python, you can use the figure() function and set the figsize argument.
- How do I set the figure title and axes labels font size?Python
In matplotlib, you can set the font size of the figure title and axes labels using the pyplot module.
- How to change the figure size of a seaborn axes or figure level plotPython
You can change the figure size of a Seaborn plot by using the set_size_inches() method of the matplotlib.pyplot.figure object and passing in the desired width and height.
- How to change the font size on a matplotlib plotPython
There are a couple of ways to change the font size on a matplotlib plot.
- How to make IPython notebook matplotlib plot inlinePython
To make matplotlib plots show up inline in an IPython notebook, you can use the following code snippet:
- How to put the legend outside the plotPython
In matplotlib, the legend function allows you to specify the location of the legend.
- How to set the y-axis limitPython
In matplotlib, you can set the limit of the y-axis of a plot by using the set_ylim() method of the Axes class.
- ImportError: No module named matplotlib.pyplotPython
This error message occurs when the matplotlib.pyplot module is not installed or not imported properly in your Python environment.
- Matplotlib make tick labels font size smallerPython
Here is a code snippet that shows how to make the tick labels font size smaller in Matplotlib:
- Plot logarithmic axesPython
Here is a code snippet that shows how to plot a graph with logarithmic scales for both the x and y axes in Python using the Matplotlib library:
- Purpose of "%matplotlib inline"Python
The purpose of "%matplotlib inline" in Python is to display matplotlib plots within the Jupyter notebook.
- Save plot to image file instead of displaying it using MatplotlibPython
To save a plot to an image file using Matplotlib, you can use the savefig function.
- When to use cla(), clf() or close() for clearing a plot in matplotlib?Python
cla() is used to clear the current axis of a plot in matplotlib.