KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I use matplotib's Axes API to plot some figures. One of the lines I plot represents the theoretical expected line. It has no meaning outside of the original y and x limits. What I want, is for matlplotlib to ignore it when autoscaling the limits. What I used to do, is to check what are the current limits, then plot, and reset the limits. The problem is that when I plot a third plot, the limits get recalculated together with the theoretical line, and that really expands the graph. # Boilerplate from matplotlib.figure import Figure from matplotlib.backends.backend_pdf import FigureCanvasPdf from numpy import sin, linspace fig = Figure() ax = fig.add_subplot(1,1,1) x1 = linspace(-1,1,100) ax.plot(x1, sin(x1)) ax.plot(x1, 3*sin(x1)) # I wish matplotlib would not consider the second plot when rescaling ax.plot(x1, sin(x1/2.0)) # But would consider the first and last canvas_pdf = FigureCanvasPdf(fig) canvas_pdf.print_figure("test.pdf")
Tags (comma-separated)
Save Edits
Cancel