Next, a graph is generated with three data points: (0, 0), (0, 0.5) and (1, 1). Only that part of the plotted points (small circles) that lie inside the graph area is visible, so I see a quarter of the circles in the corners and a semicircle along the left side of the spine.
Is there a trick I can use to make all points fully visible so that they are not cropped in the axis frame?
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure fig = Figure() canvas = FigureCanvas(fig) ax = fig.add_subplot(111) ax.plot([0, 0, 1], [0, 0.5, 1], 'o') fig.canvas.print_figure('test.png')
Edit: The Amro proposal - the obvious approach - is not the preferred approach, as it is for ROC plots (usually drawn with a field from 0 to 1 on both axes). If I could trick matplotlib to get results similar to many in http://www.google.com/search?q=roc+plot that have a rectangular border around 0..1 on both axes, but there are dots drawn on top axis lines, like many of them, which would be optimal.
Edit 2: I assume this can be done using " spinal placement " (new from MPL 0.99), with the plot area being increased slightly, as suggested by Amro, but then the spikes were moved slightly on both O axes. I will experiment with this and publish the answer if it works, although I donβt want to beat it.
source share