axis scaling anomaly

Just a little follow-up point. The normal axis autoscaling, with "plot(t, s, 'b-')" commented out, doesn't take account of the errorbar extrema. That is, the errorbars extend beyond the autoscaled window, whereas the window should be scaled to fully contain the errorbars.


----- Original Message -----
From: "Gary Ruben" <gazzar@...25...>
Date: Thu, 22 Apr 2004 20:19:10 +1000
Subject: [Matplotlib-users] axis scaling anomaly

Here's an example of my attempt to plot errorbar data with a series line of a different colour. This example reveals an anomaly with the axis scaling which may the sign of an underlying bug. If you comment out the "plot(t, s, 'b-')" line and run the example, the axes autoscale. If you run the example as is, the scaling changes for some reason.
Gary Ruben

from matplotlib.matlab import *

t = arange(0.1, 4, 0.1)
s = exp(-t)
e = 0.1*randn(len(s))
f = 0.1*randn(len(s))

lines = errorbar(t, s, e, f, '.', capsize=4)
set(lines, 'color', 'g')
plot(t, s, 'b-')
xlabel('Distance (m)')
ylabel('Height (m)')
title('Mean and standard error as a function of distance')

Sign-up for Ads Free at