Placing text next to axvline
I need to mark certain values in a plot without changing axes limits, e.g., I want a vertical line at x=pi/2
to mark the max(cos(x))
but I don’t want to figure out the appropriate y
limits and I just want my vertical line to go from 33% to 67% of the axes. So, as per vertical & horizontal lines in matplotlib, I am using axvline
.
Matplotlib.scatter documentation covers some parameters unclearly
I was searching for how to plot a scatter plot with points that have a transparent face but coloured edges. This page gave some ideas, but I find the behaviour of some arguments to differ than reported there. For example, one answer describes argument c
as affecting both face color and edge color, causing arguments for the latter two to be ignored. In contrast I found the following to be synonymous: c
, color
, facecolor
, facecolors
.
How to project a contour map on the xy plane using matplotlib?
How can I plot a contour map on the xy plane rather than on the 3d surface of the function?
This is my current output:
How to plot circles with custom size and gradient
I have two numpy arrays where one should be used to determine the radius of matplotlib.patches.Circle
and the other should be used to determine its colour from a diverging colourmap. Positive values in data
should be orange and negative values blue.
Matplotlib causing error code 1 on vscode [closed]
Closed 6 hours ago.
Match plot size with size of data
I’m trying to plot weather data from a Numpy array (precipitation in this example) in matplot using a filled contour. I am currently having issues with missing data and lines at the edge of data values. I suspect this is related to the figure size and resolution of the plot not matching the source array – I’d like each pixel to represent one point in the array but I’m not sure how to accomplish this.
how does plt.figure() works
we know that plt.figure() will create an image window and all subsequent plots will go into that.
Modify Pareto-frontier Plot for double boxplots
I have the following code that plots the results of two mathematical MILPS with different parameter combinations and determines the Pareto front based on the points. The code is:
Get the DPI for a PyPlot figure
At least in Spyder, the PyPlot plots can be low resolution, e.g., from:
pyplot.hexbin doesn’t use axis ranges correctly
My hexbin plot won’t center at xC=0, yC=0 even though both axes are symmetric.
I’ve marked the center with green lines. As you can see, it does not match. The center of the last bins on the left are exactly where they are supposed to be, at -1.016*0.5. The center of the last bins on the right aren’t. Same problem for the y-axis. The bottom is correct and the top isn’t.