Maybe this question exists already, but I could not find it.
I am making plots in Python. I don't want to set my axes range such that all points are included - there are some really high or really low values, and all I care about in those points is that they exist - that is, they need to be in the plot, but not on their actual value - rather, somewhere on the top of the canvas.
So i found something that helps a bit in achieving what i want to do in this question Link
So basically this thing works:
But when I tried something like this then it didn't work.
xmin=0.8 xmax=0.18 plt.(np.minimum(x, xmin,xmax),y)
How can i solve this?
To force the points above a threshold to a maximum level you may use
To force the points below a threshold to a minimum level you may use
To do both you may combine the two commands
xlimited = np.minimum(np.maximum(x,xmin),xmax)
Note that to have the points restricted in the vertical direction you would do this to the
y values of course.