From: <jd...@us...> - 2009-07-31 15:32:17
|
Revision: 7323 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7323&view=rev Author: jdh2358 Date: 2009-07-31 15:32:11 +0000 (Fri, 31 Jul 2009) Log Message: ----------- apply sf patches 2830233 and 2823885 for osx setup and 64 bit; thanks Michiel Modified Paths: -------------- branches/v0_99_maint/release/osx/Makefile branches/v0_99_maint/setupext.py branches/v0_99_maint/src/_macosx.m Modified: branches/v0_99_maint/release/osx/Makefile =================================================================== --- branches/v0_99_maint/release/osx/Makefile 2009-07-31 13:49:33 UTC (rev 7322) +++ branches/v0_99_maint/release/osx/Makefile 2009-07-31 15:32:11 UTC (rev 7323) @@ -2,7 +2,7 @@ ZLIBVERSION=1.2.3 PNGVERSION=1.2.33 FREETYPEVERSION=2.3.7 -MPLVERSION=0.98.5.3 +MPLVERSION=0.99.0.rc1 MPLSRC=matplotlib-${MPLVERSION} MACOSX_DEPLOYMENT_TARGET=10.4 Modified: branches/v0_99_maint/setupext.py =================================================================== --- branches/v0_99_maint/setupext.py 2009-07-31 13:49:33 UTC (rev 7322) +++ branches/v0_99_maint/setupext.py 2009-07-31 15:32:11 UTC (rev 7323) @@ -51,7 +51,7 @@ 'linux' : ['/usr/local', '/usr',], 'cygwin' : ['/usr/local', '/usr',], 'darwin' : ['/sw/lib/freetype2', '/sw/lib/freetype219', '/usr/local', - '/usr', '/sw', '/usr/X11R6'], + '/usr', '/sw'], 'freebsd4' : ['/usr/local', '/usr'], 'freebsd5' : ['/usr/local', '/usr'], 'freebsd6' : ['/usr/local', '/usr'], Modified: branches/v0_99_maint/src/_macosx.m =================================================================== --- branches/v0_99_maint/src/_macosx.m 2009-07-31 13:49:33 UTC (rev 7322) +++ branches/v0_99_maint/src/_macosx.m 2009-07-31 15:32:11 UTC (rev 7323) @@ -7,15 +7,19 @@ static int nwin = 0; /* The number of open windows */ + +/* Use Atsui for Mac OS X 10.4, CoreText for Mac OS X 10.5 */ +#ifndef MAC_OS_X_VERSION_10_5 static int ngc = 0; /* The number of graphics contexts in use */ /* For drawing Unicode strings with ATSUI */ static ATSUStyle style = NULL; static ATSUTextLayout layout = NULL; +#endif /* CGFloat was defined in Mac OS X 10.5 */ -#ifndef CGFloat +#ifndef CGFLOAT_DEFINED #define CGFloat float #endif @@ -171,6 +175,7 @@ return 1; } +#ifndef MAC_OS_X_VERSION_10_5 static int _init_atsui(void) { OSStatus status; @@ -208,6 +213,7 @@ if (status!=noErr) PyErr_WarnEx(PyExc_RuntimeWarning, "ATSUDisposeTextLayout failed", 1); } +#endif static int _draw_path(CGContextRef cr, void* iterator) { @@ -336,6 +342,10 @@ - (void)mouseUp:(NSEvent*)event; - (void)mouseDragged:(NSEvent*)event; - (void)mouseMoved:(NSEvent*)event; +- (void)rightMouseDown:(NSEvent*)event; +- (void)rightMouseUp:(NSEvent*)event; +- (void)otherMouseDown:(NSEvent*)event; +- (void)otherMouseUp:(NSEvent*)event; - (void)setRubberband:(NSRect)rect; - (void)removeRubberband; - (const char*)convertKeyEvent:(NSEvent*)event; @@ -375,6 +385,7 @@ CGContextRef cr; NSSize size; int level; + CGFloat color[4]; } GraphicsContext; static CGMutablePathRef _create_path(void* iterator) @@ -440,6 +451,7 @@ self->cr = NULL; self->level = 0; +#ifndef MAC_OS_X_VERSION_10_5 if (ngc==0) { int ok = _init_atsui(); @@ -449,10 +461,12 @@ } } ngc++; +#endif return (PyObject*) self; } +#ifndef MAC_OS_X_VERSION_10_5 static void GraphicsContext_dealloc(GraphicsContext *self) { @@ -461,6 +475,7 @@ self->ob_type->tp_free((PyObject*)self); } +#endif static PyObject* GraphicsContext_repr(GraphicsContext* self) @@ -516,6 +531,9 @@ return NULL; } CGContextSetAlpha(cr, alpha); + + self->color[3] = alpha; + Py_INCREF(Py_None); return Py_None; } @@ -651,7 +669,7 @@ static BOOL _set_dashes(CGContextRef cr, PyObject* linestyle) { - float phase = 0.0; + CGFloat phase = 0.0; PyObject* offset; PyObject* dashes; @@ -686,7 +704,7 @@ } int n = PyTuple_GET_SIZE(dashes); int i; - float* lengths = malloc(n*sizeof(float)); + CGFloat* lengths = malloc(n*sizeof(CGFloat)); if(!lengths) { PyErr_SetString(PyExc_MemoryError, "Failed to store dashes"); @@ -697,9 +715,9 @@ { PyObject* value = PyTuple_GET_ITEM(dashes, i); if (PyFloat_Check(value)) - lengths[i] = (float) PyFloat_AS_DOUBLE(value); + lengths[i] = (CGFloat) PyFloat_AS_DOUBLE(value); else if (PyInt_Check(value)) - lengths[i] = (float) PyInt_AS_LONG(value); + lengths[i] = (CGFloat) PyInt_AS_LONG(value); else break; } Py_DECREF(dashes); @@ -750,6 +768,11 @@ CGContextSetRGBStrokeColor(cr, r, g, b, 1.0); CGContextSetRGBFillColor(cr, r, g, b, 1.0); + + self->color[0] = r; + self->color[1] = g; + self->color[2] = b; + Py_INCREF(Py_None); return Py_None; } @@ -889,28 +912,12 @@ } else { - int ok; - float color[4] = {0, 0, 0, 1}; CGPatternRef pattern; CGColorSpaceRef baseSpace; CGColorSpaceRef patternSpace; static const CGPatternCallbacks callbacks = {0, &_draw_hatch, &_release_hatch}; - PyObject* rgb = PyObject_CallMethod((PyObject*)self, "get_rgb", ""); - if (!rgb) - { - Py_DECREF(hatchpath); - return NULL; - } - ok = PyArg_ParseTuple(rgb, "ffff", &color[0], &color[1], &color[2], &color[3]); - Py_DECREF(rgb); - if (!ok) - { - Py_DECREF(hatchpath); - return NULL; - } - baseSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); if (!baseSpace) { @@ -938,7 +945,7 @@ kCGPatternTilingNoDistortion, false, &callbacks); - CGContextSetFillPattern(cr, pattern, color); + CGContextSetFillPattern(cr, pattern, self->color); CGPatternRelease(pattern); iterator = get_path_iterator(path, transform, @@ -1227,6 +1234,8 @@ if (Ntransforms) { + CGAffineTransform master; + double a, b, c, d, tx, ty; PyObject* values = PyObject_CallMethod(master_transform, "to_values", ""); if (!values) { @@ -1239,15 +1248,15 @@ ok = 0; goto exit; } - CGAffineTransform master; - ok = PyArg_ParseTuple(values, "ffffff", - &master.a, - &master.b, - &master.c, - &master.d, - &master.tx, - &master.ty); + /* CGAffineTransform contains CGFloat; cannot use master directly */ + ok = PyArg_ParseTuple(values, "dddddd", &a, &b, &c, &d, &tx, &ty); Py_DECREF(values); + master.a = a; + master.b = b; + master.c = c; + master.d = d; + master.tx = tx; + master.ty = ty; if (!ok) goto exit; CGContextConcatCTM(cr, master); } @@ -1652,13 +1661,15 @@ } if (PyTuple_Check(values)) { - ok = PyArg_ParseTuple(values, "ffffff", - &master.a, - &master.b, - &master.c, - &master.d, - &master.tx, - &master.ty); + double a, b, c, d, tx, ty; + /* CGAffineTransform contains CGFloat; cannot use master directly */ + ok = PyArg_ParseTuple(values, "dddddd", &a, &b, &c, &d, &tx, &ty); + master.a = a; + master.b = b; + master.c = c; + master.d = d; + master.tx = tx; + master.ty = ty; } else { @@ -1866,7 +1877,11 @@ } +#ifdef MAC_OS_X_VERSION_10_5 +static CTFontRef +#else static ATSFontRef +#endif setfont(CGContextRef cr, PyObject* family, float size, const char weight[], const char italic[]) { @@ -1876,7 +1891,11 @@ const char* temp; const char* name = "Times-Roman"; CFStringRef string; - ATSFontRef atsfont = 0; +#ifdef MAC_OS_X_VERSION_10_5 + CTFontRef font = 0; +#else + ATSFontRef font = 0; +#endif const int k = (strcmp(italic, "italic") ? 0 : 2) + (strcmp(weight, "bold") ? 0 : 1); @@ -2072,26 +2091,38 @@ string = CFStringCreateWithCString(kCFAllocatorDefault, temp, kCFStringEncodingMacRoman); - atsfont = ATSFontFindFromPostScriptName(string, kATSOptionFlagsDefault); +#ifdef MAC_OS_X_VERSION_10_5 + font = CTFontCreateWithName(string, size, NULL); +#else + font = ATSFontFindFromPostScriptName(string, kATSOptionFlagsDefault); +#endif + CFRelease(string); - if(atsfont) + if(font) { name = temp; break; } } - if(!atsfont) + if(!font) { string = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingMacRoman); - atsfont = ATSFontFindFromPostScriptName(string, kATSOptionFlagsDefault); +#ifdef MAC_OS_X_VERSION_10_5 + font = CTFontCreateWithName(string, size, NULL); +#else + font = ATSFontFindFromPostScriptName(string, kATSOptionFlagsDefault); +#endif CFRelease(string); } +#ifndef MAC_OS_X_VERSION_10_5 CGContextSelectFont(cr, name, size, kCGEncodingMacRoman); - return atsfont; +#endif + return font; } +#ifdef MAC_OS_X_VERSION_10_5 static PyObject* GraphicsContext_draw_text (GraphicsContext* self, PyObject* args) { @@ -2104,6 +2135,174 @@ const char* weight; const char* italic; float angle; + CTFontRef font; + CGColorRef color; + CGFloat descent; + + CFStringRef keys[2]; + CFTypeRef values[2]; + + CGContextRef cr = self->cr; + if (!cr) + { + PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL"); + return NULL; + } + + if(!PyArg_ParseTuple(args, "ffu#Ofssf", + &x, + &y, + &text, + &n, + &family, + &size, + &weight, + &italic, + &angle)) return NULL; + + font = setfont(cr, family, size, weight, italic); + + color = CGColorCreateGenericRGB(self->color[0], + self->color[1], + self->color[2], + self->color[3]); + + keys[0] = kCTFontAttributeName; + keys[1] = kCTForegroundColorAttributeName; + values[0] = font; + values[1] = color; + CFDictionaryRef attributes = CFDictionaryCreate(kCFAllocatorDefault, + (const void**)&keys, + (const void**)&values, + 2, + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); + CGColorRelease(color); + CFRelease(font); + + CFStringRef s = CFStringCreateWithCharacters(kCFAllocatorDefault, text, n); + + CFAttributedStringRef string = CFAttributedStringCreate(kCFAllocatorDefault, + s, + attributes); + CFRelease(s); + CFRelease(attributes); + + CTLineRef line = CTLineCreateWithAttributedString(string); + CFRelease(string); + + CTLineGetTypographicBounds(line, NULL, &descent, NULL); + + if (!line) + { + PyErr_SetString(PyExc_RuntimeError, + "CTLineCreateWithAttributedString failed"); + return NULL; + } + + CGContextSetTextMatrix(cr, CGAffineTransformIdentity); + if (angle) + { + CGContextSaveGState(cr); + CGContextTranslateCTM(cr, x, y); + CGContextRotateCTM(cr, angle*M_PI/180); + CTLineDraw(line, cr); + CGContextRestoreGState(cr); + } + else + { + CGContextSetTextPosition(cr, x, y); + CTLineDraw(line, cr); + } + CFRelease(line); + + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject* +GraphicsContext_get_text_width_height_descent(GraphicsContext* self, PyObject* args) +{ + const UniChar* text; + int n; + PyObject* family; + float size; + const char* weight; + const char* italic; + + CGFloat ascent; + CGFloat descent; + double width; + CGRect rect; + + CTFontRef font; + + CGContextRef cr = self->cr; + if (!cr) + { + PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL"); + return NULL; + } + + if(!PyArg_ParseTuple(args, "u#Ofss", + &text, &n, &family, &size, &weight, &italic)) + return NULL; + + font = setfont(cr, family, size, weight, italic); + + CFStringRef keys[1]; + CFTypeRef values[1]; + + keys[0] = kCTFontAttributeName; + values[0] = font; + CFDictionaryRef attributes = CFDictionaryCreate(kCFAllocatorDefault, + (const void**)&keys, + (const void**)&values, + 1, + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); + CFRelease(font); + + CFStringRef s = CFStringCreateWithCharacters(kCFAllocatorDefault, text, n); + + CFAttributedStringRef string = CFAttributedStringCreate(kCFAllocatorDefault, + s, + attributes); + CFRelease(s); + CFRelease(attributes); + + CTLineRef line = CTLineCreateWithAttributedString(string); + CFRelease(string); + + if (!line) + { + PyErr_SetString(PyExc_RuntimeError, + "CTLineCreateWithAttributedString failed"); + return NULL; + } + + width = CTLineGetTypographicBounds(line, &ascent, &descent, NULL); + rect = CTLineGetImageBounds(line, cr); + + CFRelease(line); + + return Py_BuildValue("fff", width, rect.size.height, descent); +} + +#else + +static PyObject* +GraphicsContext_draw_text (GraphicsContext* self, PyObject* args) +{ + float x; + float y; + const UniChar* text; + int n; + PyObject* family; + float size; + const char* weight; + const char* italic; + float angle; ATSFontRef atsfont; CGContextRef cr = self->cr; if (!cr) @@ -2188,6 +2387,102 @@ return Py_None; } +static PyObject* +GraphicsContext_get_text_width_height_descent(GraphicsContext* self, PyObject* args) +{ + const UniChar* text; + int n; + PyObject* family; + float size; + const char* weight; + const char* italic; + + ATSFontRef atsfont; + + CGContextRef cr = self->cr; + if (!cr) + { + PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL"); + return NULL; + } + + if(!PyArg_ParseTuple(args, "u#Ofss", &text, &n, &family, &size, &weight, &italic)) return NULL; + + atsfont = setfont(cr, family, size, weight, italic); + + OSStatus status = noErr; + ATSUAttributeTag tags[] = {kATSUFontTag, + kATSUSizeTag, + kATSUQDBoldfaceTag, + kATSUQDItalicTag}; + ByteCount sizes[] = {sizeof(ATSUFontID), + sizeof(Fixed), + sizeof(Boolean), + sizeof(Boolean)}; + Fixed atsuSize = Long2Fix(size); + Boolean isBold = FALSE; /* setfont takes care of this */ + Boolean isItalic = FALSE; /* setfont takes care of this */ + ATSUAttributeValuePtr values[] = {&atsfont, &atsuSize, &isBold, &isItalic}; + + status = ATSUSetAttributes(style, 4, tags, sizes, values); + if (status!=noErr) + { + PyErr_SetString(PyExc_RuntimeError, "ATSUSetAttributes failed"); + return NULL; + } + + status = ATSUSetTextPointerLocation(layout, + text, + kATSUFromTextBeginning, /* offset from beginning */ + kATSUToTextEnd, /* length of text range */ + n); /* length of text buffer */ + if (status!=noErr) + { + PyErr_SetString(PyExc_RuntimeError, + "ATSUCreateTextLayoutWithTextPtr failed"); + return NULL; + } + + status = ATSUSetRunStyle(layout, + style, + kATSUFromTextBeginning, + kATSUToTextEnd); + if (status!=noErr) + { + PyErr_SetString(PyExc_RuntimeError, "ATSUSetRunStyle failed"); + return NULL; + } + + ATSUAttributeTag tag = kATSUCGContextTag; + ByteCount bc = sizeof (CGContextRef); + ATSUAttributeValuePtr value = &cr; + status = ATSUSetLayoutControls(layout, 1, &tag, &bc, &value); + if (status!=noErr) + { + PyErr_SetString(PyExc_RuntimeError, "ATSUSetLayoutControls failed"); + return NULL; + } + + ATSUTextMeasurement before; + ATSUTextMeasurement after; + ATSUTextMeasurement ascent; + ATSUTextMeasurement descent; + status = ATSUGetUnjustifiedBounds(layout, + kATSUFromTextBeginning, kATSUToTextEnd, + &before, &after, &ascent, &descent); + if (status!=noErr) + { + PyErr_SetString(PyExc_RuntimeError, "ATSUGetUnjustifiedBounds failed"); + return NULL; + } + + const float width = FixedToFloat(after-before); + const float height = FixedToFloat(ascent-descent); + + return Py_BuildValue("fff", width, height, FixedToFloat(descent)); +} +#endif + static void _data_provider_release(void* info, const void* data, size_t size) { PyObject* image = (PyObject*)info; @@ -2293,101 +2588,6 @@ } static PyObject* -GraphicsContext_get_text_width_height_descent(GraphicsContext* self, PyObject* args) -{ - const UniChar* text; - int n; - PyObject* family; - float size; - const char* weight; - const char* italic; - - ATSFontRef atsfont; - - CGContextRef cr = self->cr; - if (!cr) - { - PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL"); - return NULL; - } - - if(!PyArg_ParseTuple(args, "u#Ofss", &text, &n, &family, &size, &weight, &italic)) return NULL; - - atsfont = setfont(cr, family, size, weight, italic); - - OSStatus status = noErr; - ATSUAttributeTag tags[] = {kATSUFontTag, - kATSUSizeTag, - kATSUQDBoldfaceTag, - kATSUQDItalicTag}; - ByteCount sizes[] = {sizeof(ATSUFontID), - sizeof(Fixed), - sizeof(Boolean), - sizeof(Boolean)}; - Fixed atsuSize = Long2Fix(size); - Boolean isBold = FALSE; /* setfont takes care of this */ - Boolean isItalic = FALSE; /* setfont takes care of this */ - ATSUAttributeValuePtr values[] = {&atsfont, &atsuSize, &isBold, &isItalic}; - - status = ATSUSetAttributes(style, 4, tags, sizes, values); - if (status!=noErr) - { - PyErr_SetString(PyExc_RuntimeError, "ATSUSetAttributes failed"); - return NULL; - } - - status = ATSUSetTextPointerLocation(layout, - text, - kATSUFromTextBeginning, /* offset from beginning */ - kATSUToTextEnd, /* length of text range */ - n); /* length of text buffer */ - if (status!=noErr) - { - PyErr_SetString(PyExc_RuntimeError, - "ATSUCreateTextLayoutWithTextPtr failed"); - return NULL; - } - - status = ATSUSetRunStyle(layout, - style, - kATSUFromTextBeginning, - kATSUToTextEnd); - if (status!=noErr) - { - PyErr_SetString(PyExc_RuntimeError, "ATSUSetRunStyle failed"); - return NULL; - } - - ATSUAttributeTag tag = kATSUCGContextTag; - ByteCount bc = sizeof (CGContextRef); - ATSUAttributeValuePtr value = &cr; - status = ATSUSetLayoutControls(layout, 1, &tag, &bc, &value); - if (status!=noErr) - { - PyErr_SetString(PyExc_RuntimeError, "ATSUSetLayoutControls failed"); - return NULL; - } - - ATSUTextMeasurement before; - ATSUTextMeasurement after; - ATSUTextMeasurement ascent; - ATSUTextMeasurement descent; - status = ATSUGetUnjustifiedBounds(layout, - kATSUFromTextBeginning, kATSUToTextEnd, - &before, &after, &ascent, &descent); - if (status!=noErr) - { - PyErr_SetString(PyExc_RuntimeError, "ATSUGetUnjustifiedBounds failed"); - return NULL; - } - - const float width = FixedToFloat(after-before); - const float height = FixedToFloat(ascent-descent); - - return Py_BuildValue("fff", width, height, FixedToFloat(descent)); -} - -static PyObject* GraphicsContext_draw_image(GraphicsContext* self, PyObject* args) { float x, y; @@ -2621,7 +2821,11 @@ "_macosx.GraphicsContext", /*tp_name*/ sizeof(GraphicsContext), /*tp_basicsize*/ 0, /*tp_itemsize*/ +#ifdef MAC_OS_X_VERSION_10_5 + 0, /*tp_dealloc*/ +#else (destructor)GraphicsContext_dealloc, /*tp_dealloc*/ +#endif 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -2826,15 +3030,18 @@ int n; const unichar* characters; NSSize size; + double width, height; if(!view) { PyErr_SetString(PyExc_RuntimeError, "NSView* is NULL"); return NULL; } - if(!PyArg_ParseTuple(args, "u#ff", - &characters, &n, - &size.width, &size.height)) return NULL; + /* NSSize contains CGFloat; cannot use size directly */ + if(!PyArg_ParseTuple(args, "u#dd", + &characters, &n, &width, &height)) return NULL; + size.width = width; + size.height = height; /* This function may be called from inside the event loop, when an * autorelease pool is available, or from Python, when no autorelease @@ -4492,6 +4699,86 @@ PyGILState_Release(gstate); } +- (void)rightMouseDown:(NSEvent *)event +{ + int x, y; + int num = 3; + PyObject* result; + PyGILState_STATE gstate; + NSPoint location = [event locationInWindow]; + location = [self convertPoint: location fromView: nil]; + x = location.x; + y = location.y; + gstate = PyGILState_Ensure(); + result = PyObject_CallMethod(canvas, "button_press_event", "iii", x, y, num); + if(result) + Py_DECREF(result); + else + PyErr_Print(); + + PyGILState_Release(gstate); +} + +- (void)rightMouseUp:(NSEvent *)event +{ + int x, y; + int num = 3; + PyObject* result; + PyGILState_STATE gstate; + NSPoint location = [event locationInWindow]; + location = [self convertPoint: location fromView: nil]; + x = location.x; + y = location.y; + gstate = PyGILState_Ensure(); + result = PyObject_CallMethod(canvas, "button_release_event", "iii", x, y, num); + if(result) + Py_DECREF(result); + else + PyErr_Print(); + + PyGILState_Release(gstate); +} + +- (void)otherMouseDown:(NSEvent *)event +{ + int x, y; + int num = 2; + PyObject* result; + PyGILState_STATE gstate; + NSPoint location = [event locationInWindow]; + location = [self convertPoint: location fromView: nil]; + x = location.x; + y = location.y; + gstate = PyGILState_Ensure(); + result = PyObject_CallMethod(canvas, "button_press_event", "iii", x, y, num); + if(result) + Py_DECREF(result); + else + PyErr_Print(); + + PyGILState_Release(gstate); +} + +- (void)otherMouseUp:(NSEvent *)event +{ + int x, y; + int num = 2; + PyObject* result; + PyGILState_STATE gstate; + NSPoint location = [event locationInWindow]; + location = [self convertPoint: location fromView: nil]; + x = location.x; + y = location.y; + gstate = PyGILState_Ensure(); + result = PyObject_CallMethod(canvas, "button_release_event", "iii", x, y, num); + if(result) + Py_DECREF(result); + else + PyErr_Print(); + + PyGILState_Release(gstate); +} + - (void)setRubberband:(NSRect)rect { if (!NSIsEmptyRect(rubberband)) [self setNeedsDisplayInRect: rubberband]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-07-31 15:52:28
|
Revision: 7325 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7325&view=rev Author: jdh2358 Date: 2009-07-31 15:52:19 +0000 (Fri, 31 Jul 2009) Log Message: ----------- added miktex win32 patch from sf patch 2820194 Modified Paths: -------------- branches/v0_99_maint/lib/matplotlib/texmanager.py branches/v0_99_maint/setupext.py Modified: branches/v0_99_maint/lib/matplotlib/texmanager.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/texmanager.py 2009-07-31 15:39:30 UTC (rev 7324) +++ branches/v0_99_maint/lib/matplotlib/texmanager.py 2009-07-31 15:52:19 UTC (rev 7325) @@ -56,7 +56,7 @@ def dvipng_hack_alpha(): p = Popen('dvipng -version', shell=True, stdin=PIPE, stdout=PIPE, - stderr=STDOUT, close_fds=True) + stderr=STDOUT, close_fds=(sys.platform!='win32')) stdin, stdout = p.stdin, p.stdout for line in stdout: if line.startswith('dvipng '): Modified: branches/v0_99_maint/setupext.py =================================================================== --- branches/v0_99_maint/setupext.py 2009-07-31 15:39:30 UTC (rev 7324) +++ branches/v0_99_maint/setupext.py 2009-07-31 15:52:19 UTC (rev 7325) @@ -174,7 +174,7 @@ stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, - close_fds=True) + close_fds=(sys.platform != 'win32')) return p.stdin, p.stdout class CleanUpFile: @@ -458,7 +458,7 @@ try: stdin, stdout = run_child_process('latex -version') line = stdout.readlines()[0] - pattern = '3\.1\d+' + pattern = '(3\.1\d+)|(MiKTeX \d+.\d+)' match = re.search(pattern, line) print_status("latex", match.group(0)) return True This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-01 17:37:34
|
Revision: 7328 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7328&view=rev Author: jdh2358 Date: 2009-08-01 17:37:26 +0000 (Sat, 01 Aug 2009) Log Message: ----------- Applied Michiel's sf patch 2823885 to remove the /usr/X11R6 dirs from darwin Modified Paths: -------------- branches/v0_99_maint/doc/_templates/index.html branches/v0_99_maint/doc/users/installing.rst branches/v0_99_maint/setupext.py Modified: branches/v0_99_maint/doc/_templates/index.html =================================================================== --- branches/v0_99_maint/doc/_templates/index.html 2009-07-31 18:55:17 UTC (rev 7327) +++ branches/v0_99_maint/doc/_templates/index.html 2009-08-01 17:37:26 UTC (rev 7328) @@ -3,7 +3,7 @@ {% block body %} - <h1>Welcome</h1> + <h1>mpl</h1> <p>matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and Modified: branches/v0_99_maint/doc/users/installing.rst =================================================================== --- branches/v0_99_maint/doc/users/installing.rst 2009-07-31 18:55:17 UTC (rev 7327) +++ branches/v0_99_maint/doc/users/installing.rst 2009-08-01 17:37:26 UTC (rev 7328) @@ -114,7 +114,8 @@ These are external packages which you will need to install before installing matplotlib. Windows users only need the first two (python and numpy) since the others are built into the matplotlib windows -installers available for download at the sourceforge site. +installers available for download at the sourceforge site. If you are +building on OSX, see :ref:`build_osx` :term:`python` 2.4 (or later but not python3) matplotlib requires python 2.4 or later (`download <http://www.python.org/download/>`__) @@ -183,3 +184,19 @@ +.. _build_osx: + +Building on OSX +================== + +The build situation on OSX is complicated by the various places one +can get the png and freetype requirements from (darwinports, fink, +/usr/X11R6) and the different architectures (x86, ppc, universal) and +the different OSX version (10.4 and 10.5). We recommend that you build +the way we do for the OSX release: by grabbing the tarbar or svn +repository, cd-ing into the release/osx dir, and following the +instruction in the README. This directory has a Makefile which will +automatically grab the zlib, png and freetype dependencies from the +web, build them with the right flags to make universal libraries, and +then build the matplotlib source and binary installers. + \ No newline at end of file Modified: branches/v0_99_maint/setupext.py =================================================================== --- branches/v0_99_maint/setupext.py 2009-07-31 18:55:17 UTC (rev 7327) +++ branches/v0_99_maint/setupext.py 2009-08-01 17:37:26 UTC (rev 7328) @@ -51,7 +51,7 @@ 'linux' : ['/usr/local', '/usr',], 'cygwin' : ['/usr/local', '/usr',], 'darwin' : ['/sw/lib/freetype2', '/sw/lib/freetype219', '/usr/local', - '/usr', '/sw', '/usr/X11R6'], + '/usr', '/sw'], 'freebsd4' : ['/usr/local', '/usr'], 'freebsd5' : ['/usr/local', '/usr'], 'freebsd6' : ['/usr/local', '/usr'], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-01 19:12:19
|
Revision: 7329 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7329&view=rev Author: jdh2358 Date: 2009-08-01 19:11:58 +0000 (Sat, 01 Aug 2009) Log Message: ----------- some fixes for the binary builds Modified Paths: -------------- branches/v0_99_maint/doc/faq/installing_faq.rst branches/v0_99_maint/doc/users/installing.rst branches/v0_99_maint/release/osx/Makefile branches/v0_99_maint/release/osx/README.txt Modified: branches/v0_99_maint/doc/faq/installing_faq.rst =================================================================== --- branches/v0_99_maint/doc/faq/installing_faq.rst 2009-08-01 17:37:26 UTC (rev 7328) +++ branches/v0_99_maint/doc/faq/installing_faq.rst 2009-08-01 19:11:58 UTC (rev 7329) @@ -287,11 +287,66 @@ <http://www.python.org/download/>`_. +.. _install_osx_binaries: + +Installing OSX binaries +----------------------- + +If you want to install matplotlib from one of the binary installers we +build, you have two choices: a mpkg installer, which is a typical +Installer.app, or an binary OSX egg, which you can install via +setuptools easy_install. + +The mkpg installer will have a "zip" extension, and will have a name +like file:`matplotlib-0.99.0.rc1-py2.5-macosx10.5.zip` depending on +the python, matplotlib, and OSX versions. You need to unzip this file +using either the "unzip" command on OSX, or simply double clicking on +it to run StuffIt Expander. When you double click on the resultant +mpkd directory, which will have a name like +file:`matplotlib-0.99.0.rc1-py2.5-macosx10.5.mpkg`, it will run the +Installer.app, prompt you for a password if you need system wide +installation privileges, and install to a directory like +file:`/Library/Python/2.5/site-packages/`, again depedending on your +python version. This directory may not be in your python path, so you +can test your installation with:: + + > python -c 'import matplotlib; print matplotlib.__version__, matplotlib.__file__' + +If you get an error like:: + + Traceback (most recent call last): + File "<string>", line 1, in <module> + ImportError: No module named matplotlib + +then you will need to set your PYTHONPATH, eg:: + + export PYTHONPATH=/Library/Python/2.5/site-packages:$PYTHONPATH + +See also ref:`environment-variables`. + .. _easy-install-osx-egg: -easy_install from egg? +easy_install from egg ------------------------------ +You can also us the eggs we build for OSX (see the `installation +instructions +<http://pypi.python.org/pypi/setuptools#cygwin-mac-os-x-linux-other>`_ +for easy_install if you do not have it on your system already). You +can try:: + + > easy_install matplotlib + +which should grab the latest egg from the sourceforge site, but the +naming conventions for OSX eggs appear to be broken (see below) so +there is no guarantee the right egg will be found. We recommend you +download the latest egg from our `download site +<http://sourceforge.net/projects/matplotlib/files/>`_ directly to your +harddrive, and manually install it with + + > easy_install --install-dir=~/dev/lib/python2.5/site-packages/ matplotlib-0.99.0.rc1-py2.5-macosx-10.5-i386.egg + + Some users have reported problems with the egg for 0.98 from the matplotlib download site, with ``easy_install``, getting an error:: Modified: branches/v0_99_maint/doc/users/installing.rst =================================================================== --- branches/v0_99_maint/doc/users/installing.rst 2009-08-01 17:37:26 UTC (rev 7328) +++ branches/v0_99_maint/doc/users/installing.rst 2009-08-01 19:11:58 UTC (rev 7329) @@ -63,14 +63,17 @@ And a *voila*, a figure pops up. But we are putting the cart ahead of the horse -- first we need to get matplotlib installed. We provide prebuilt binaries for OS X and Windows on the matplotlib `download -<http://sourceforge.net/project/showfiles.php?group_id=80706>`_ page. -Click on the latest release of the "matplotlib" package, choose your -python version (2.4 or 2.5) and your platform (macosx or win32) and -you should be good to go. If you have any problems, please check the +<http://sourceforge.net/projects/matplotlib/files/>`_ page. Click on +the latest release of the "matplotlib" package, choose your python +version (2.4 or 2.5) and your platform (macosx or win32) and you +should be good to go. If you have any problems, please check the :ref:`installing-faq`, google around a little bit, and post a question the `mailing list <http://sourceforge.net/project/showfiles.php?group_id=80706>`_. +Instructions for installing our OSX binaries are found in the FAQ +ref:`install_osx_binaries`. + Note that when testing matplotlib installations from the interactive python console, there are some issues relating to user interface toolkits and interactive settings that are discussed in Modified: branches/v0_99_maint/release/osx/Makefile =================================================================== --- branches/v0_99_maint/release/osx/Makefile 2009-08-01 17:37:26 UTC (rev 7328) +++ branches/v0_99_maint/release/osx/Makefile 2009-08-01 19:11:58 UTC (rev 7329) @@ -1,3 +1,4 @@ +PYTHON=python2.6 SRCDIR=${PWD} ZLIBVERSION=1.2.3 PNGVERSION=1.2.33 @@ -3,4 +4,5 @@ FREETYPEVERSION=2.3.7 MPLVERSION=0.99.0.rc1 +BDISTMPKGVERSION=0.4.4 MPLSRC=matplotlib-${MPLVERSION} MACOSX_DEPLOYMENT_TARGET=10.4 @@ -20,8 +22,8 @@ clean: rm -rf zlib-${ZLIBVERSION}.tar.gz libpng-${PNGVERSION}.tar.bz2 \ - freetype-${FREETYPEVERSION}.tar.bz2 bdist_mpkg-0.4.3.tar.gz \ - bdist_mpkg-0.4.3 \ + freetype-${FREETYPEVERSION}.tar.bz2 bdist_mpkg-${BDISTMPKGVERSION}.tar.gz \ + bdist_mpkg-${BDISTMPKGVERSION} \ zlib-${ZLIBVERSION} libpng-${PNGVERSION} freetype-${FREETYPEVERSION} \ matplotlib-${MPLVERSION} *~ @@ -29,10 +31,9 @@ wget http://www.zlib.net/zlib-${ZLIBVERSION}.tar.gz &&\ wget http://internap.dl.sourceforge.net/sourceforge/libpng/libpng-${PNGVERSION}.tar.bz2 &&\ wget http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPEVERSION}.tar.bz2&&\ - wget http://pypi.python.org/packages/source/b/bdist_mpkg/bdist_mpkg-0.4.3.tar.gz&&\ - tar xvfz bdist_mpkg-0.4.3.tar.gz &&\ - patch -p0 < data/bdist.patch - echo "You need to to install bdist_mpkg-0.4.3 now" + wget http://pypi.python.org/packages/source/b/bdist_mpkg/bdist_mpkg-${BDISTMPKGVERSION}.tar.gz&&\ + tar xvfz bdist_mpkg-${BDISTMPKGVERSION}.tar.gz &&\ + echo "You need to to install bdist_mpkg-${BDISTMPKGVERSION} now" @@ -87,7 +88,7 @@ export CFLAGS=${CFLAGS} &&\ export LDFLAGS=${LDFLAGS} &&\ bdist_mpkg &&\ - python setupegg.py bdist_egg &&\ + ${PYTHON} setupegg.py bdist_egg &&\ cd dist && \ zip -ro matplotlib-${MPLVERSION}-py2.5-macosx10.5.zip matplotlib-${MPLVERSION}-py2.5-macosx10.5.mpkg Modified: branches/v0_99_maint/release/osx/README.txt =================================================================== --- branches/v0_99_maint/release/osx/README.txt 2009-08-01 17:37:26 UTC (rev 7328) +++ branches/v0_99_maint/release/osx/README.txt 2009-08-01 19:11:58 UTC (rev 7329) @@ -7,9 +7,7 @@ ------------- * :file:`bdist_mkpg` - the distutils.extension to build Installer.app - mpkg installers. It is patched from the tarball with - file:`data/bdist.patch` because 0.4.3 is broken on OS X 10.5. - Instructions on how to patch and install are below + mpkg installers. * :file:`data` - some config files and patches needed for the build @@ -38,7 +36,7 @@ * install the patched bdist_mpkg, that the fetch_deps step just created:: - cd bdist_mpkg-0.4.3 + cd bdist_mpkg-0.4.4 sudo python setup.py install * build the dependencies:: @@ -64,7 +62,7 @@ cd release/osx/ unset PKG_CONFIG_PATH make fetch_deps - cd bdist_mpkg-0.4.3 + cd bdist_mpkg-0.4.4 sudo python setup.py install cd .. make dependencies This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-01 19:28:02
|
Revision: 7330 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7330&view=rev Author: jdh2358 Date: 2009-08-01 19:27:43 +0000 (Sat, 01 Aug 2009) Log Message: ----------- more fixes for osx Modified Paths: -------------- branches/v0_99_maint/doc/faq/installing_faq.rst branches/v0_99_maint/release/osx/Makefile Modified: branches/v0_99_maint/doc/faq/installing_faq.rst =================================================================== --- branches/v0_99_maint/doc/faq/installing_faq.rst 2009-08-01 19:11:58 UTC (rev 7329) +++ branches/v0_99_maint/doc/faq/installing_faq.rst 2009-08-01 19:27:43 UTC (rev 7330) @@ -298,7 +298,7 @@ setuptools easy_install. The mkpg installer will have a "zip" extension, and will have a name -like file:`matplotlib-0.99.0.rc1-py2.5-macosx10.5.zip` depending on +like file:`matplotlib-0.99.0.rc1-py2.5-macosx10.5_mpkg.zip` depending on the python, matplotlib, and OSX versions. You need to unzip this file using either the "unzip" command on OSX, or simply double clicking on it to run StuffIt Expander. When you double click on the resultant Modified: branches/v0_99_maint/release/osx/Makefile =================================================================== --- branches/v0_99_maint/release/osx/Makefile 2009-08-01 19:11:58 UTC (rev 7329) +++ branches/v0_99_maint/release/osx/Makefile 2009-08-01 19:27:43 UTC (rev 7330) @@ -1,4 +1,5 @@ -PYTHON=python2.6 +PYVERSION=2.6 +PYTHON=python${PYVERSION} SRCDIR=${PWD} ZLIBVERSION=1.2.3 PNGVERSION=1.2.33 @@ -90,14 +91,14 @@ bdist_mpkg &&\ ${PYTHON} setupegg.py bdist_egg &&\ cd dist && \ - zip -ro matplotlib-${MPLVERSION}-py2.5-macosx10.5.zip matplotlib-${MPLVERSION}-py2.5-macosx10.5.mpkg + zip -ro matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5_mpkg.zip matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.mpkg upload: rm -rf upload &&\ mkdir upload &&\ cp matplotlib-${MPLVERSION}.tar.gz upload/ &&\ - cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}_r0-py2.5-macosx-10.3-fat.egg upload/matplotlib-${MPLVERSION}-macosx-py2.5.egg &&\ - cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}-py2.5-macosx10.5.zip upload/matplotlib-${MPLVERSION}-py2.5-mpkg.zip&&\ + cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}_r0-py${PYVERSION}-macosx-10.3-fat.egg upload/matplotlib-${MPLVERSION}-macosx-py${PYVERSION}.egg &&\ + cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.zip upload/matplotlib-${MPLVERSION}-py${PYVERSION}-mpkg.zip&&\ scp upload/* jd...@fr...:uploads/ all: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-03 16:38:32
|
Revision: 7334 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7334&view=rev Author: jdh2358 Date: 2009-08-03 16:38:25 +0000 (Mon, 03 Aug 2009) Log Message: ----------- handled sf bugs 2831556 and 2830525; better bar error messages and backend driver configs Modified Paths: -------------- branches/v0_99_maint/examples/tests/backend_driver.py branches/v0_99_maint/lib/matplotlib/axes.py Modified: branches/v0_99_maint/examples/tests/backend_driver.py =================================================================== --- branches/v0_99_maint/examples/tests/backend_driver.py 2009-08-03 16:32:38 UTC (rev 7333) +++ branches/v0_99_maint/examples/tests/backend_driver.py 2009-08-03 16:38:25 UTC (rev 7334) @@ -374,7 +374,7 @@ if backend in rcsetup.interactive_bk: tmpfile.write('show()') else: - tmpfile.write('\nsavefig("%s", dpi=150)' % outfile) + tmpfile.write('\nsavefig(r"%s", dpi=150)' % outfile) tmpfile.close() start_time = time.time() @@ -458,7 +458,7 @@ python = ['valgrind', '--tool=memcheck', '--leak-check=yes', '--log-file=%(name)s', 'python'] elif sys.platform == 'win32': - python = [r'c:\Python24\python.exe'] + python = [sys.executable] else: python = ['python'] Modified: branches/v0_99_maint/lib/matplotlib/axes.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/axes.py 2009-08-03 16:32:38 UTC (rev 7333) +++ branches/v0_99_maint/lib/matplotlib/axes.py 2009-08-03 16:38:25 UTC (rev 7334) @@ -4229,20 +4229,20 @@ # FIXME: convert the following to proper input validation # raising ValueError; don't use assert for this. - assert len(left)==nbars, "argument 'left' must be %d or scalar" % nbars - assert len(height)==nbars, ("argument 'height' must be %d or scalar" % + assert len(left)==nbars, "incompatible sizes: argument 'left' must be length %d or scalar" % nbars + assert len(height)==nbars, ("incompatible sizes: argument 'height' must be length %d or scalar" % nbars) - assert len(width)==nbars, ("argument 'width' must be %d or scalar" % + assert len(width)==nbars, ("incompatible sizes: argument 'width' must be length %d or scalar" % nbars) - assert len(bottom)==nbars, ("argument 'bottom' must be %d or scalar" % + assert len(bottom)==nbars, ("incompatible sizes: argument 'bottom' must be length %d or scalar" % nbars) if yerr is not None and len(yerr)!=nbars: raise ValueError( - "bar() argument 'yerr' must be len(%s) or scalar" % nbars) + "incompatible sizes: bar() argument 'yerr' must be len(%s) or scalar" % nbars) if xerr is not None and len(xerr)!=nbars: raise ValueError( - "bar() argument 'xerr' must be len(%s) or scalar" % nbars) + "incompatible sizes: bar() argument 'xerr' must be len(%s) or scalar" % nbars) patches = [] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-03 19:31:11
|
Revision: 7337 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7337&view=rev Author: jdh2358 Date: 2009-08-03 19:31:05 +0000 (Mon, 03 Aug 2009) Log Message: ----------- removed a couple of cases of mlab.load Modified Paths: -------------- branches/v0_99_maint/doc/_templates/indexsidebar.html branches/v0_99_maint/doc/api/spine_api.rst branches/v0_99_maint/doc/pyplots/plotmap.py branches/v0_99_maint/examples/pylab_examples/load_converter.py Modified: branches/v0_99_maint/doc/_templates/indexsidebar.html =================================================================== --- branches/v0_99_maint/doc/_templates/indexsidebar.html 2009-08-03 17:40:17 UTC (rev 7336) +++ branches/v0_99_maint/doc/_templates/indexsidebar.html 2009-08-03 19:31:05 UTC (rev 7337) @@ -3,17 +3,12 @@ <p>Please <a href="http://sourceforge.net/project/project_donations.php?group_id=80706">donate</a> to support matplotlib development.</p> -<p>Watch a <a href="http://videolectures.net/mloss08_hunter_mat">video lecture</a> about matplotlib presented at <a href="http://videolectures.net/mloss08_whistler">NIPS 08 Workshop</a> <i>Machine Learning Open Source Software</i></a>. +<p>A release candidate rc1 of matplotlib-0.99.0 is <a href="http://drop.io/xortel1#">available</a> for testing. Please post any bugs to the <a href="http://sourceforge.net/tracker2/?group_id=80706">tracker</a> </p> -<p>Nominate matplotlib for a community choice award by clicking the -image below -- suggested category "Best Project for Academia" for -software which "helps you hit the books, analyze global trends, or -just understand the world a little bit better than you did before": -<a href="http://sourceforge.net/community/cca09/nominate/?project_name=matplotlib&project_url=http://sourceforge.net/projects/matplotlib/"><img src="http://sourceforge.net/images/cca/cca_nominate.png" border="0"/></a> +<p>Watch a <a href="http://videolectures.net/mloss08_hunter_mat">video lecture</a> about matplotlib presented at <a href="http://videolectures.net/mloss08_whistler">NIPS 08 Workshop</a> <i>Machine Learning Open Source Software</i></a>. </p> - <h3>Download</h3> <p>Current version: <b>{{ version }}</b></p> Modified: branches/v0_99_maint/doc/api/spine_api.rst =================================================================== --- branches/v0_99_maint/doc/api/spine_api.rst 2009-08-03 17:40:17 UTC (rev 7336) +++ branches/v0_99_maint/doc/api/spine_api.rst 2009-08-03 19:31:05 UTC (rev 7337) @@ -4,7 +4,7 @@ :mod:`matplotlib.spine` -====================== +======================== .. automodule:: matplotlib.spine :members: Modified: branches/v0_99_maint/doc/pyplots/plotmap.py =================================================================== --- branches/v0_99_maint/doc/pyplots/plotmap.py 2009-08-03 17:40:17 UTC (rev 7336) +++ branches/v0_99_maint/doc/pyplots/plotmap.py 2009-08-03 19:31:05 UTC (rev 7337) @@ -5,7 +5,9 @@ # the data is interpolated to the native projection grid. import os from mpl_toolkits.basemap import Basemap, shiftgrid -from pylab import title, colorbar, show, axes, cm, load, arange, figure, \ +import numpy as np + +from pylab import title, colorbar, show, axes, cm, arange, figure, \ text # read in topo data (on a regular lat/lon grid) @@ -15,9 +17,9 @@ if not os.path.exists(datadir): raise SystemExit('You need to download the data with svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/htdocs/screenshots/data/" and set the datadir variable in %s'%__file__) -topoin = load(os.path.join(datadir, 'etopo20data.gz')) -lons = load(os.path.join(datadir, 'etopo20lons.gz')) -lats = load(os.path.join(datadir, 'etopo20lats.gz')) +topoin = np.loadtxt(os.path.join(datadir, 'etopo20data.gz')) +lons = np.loadtxt(os.path.join(datadir, 'etopo20lons.gz')) +lats = np.loadtxt(os.path.join(datadir, 'etopo20lats.gz')) # shift data so lons go from -180 to 180 instead of 20 to 380. topoin,lons = shiftgrid(180.,topoin,lons,start=False) Modified: branches/v0_99_maint/examples/pylab_examples/load_converter.py =================================================================== --- branches/v0_99_maint/examples/pylab_examples/load_converter.py 2009-08-03 17:40:17 UTC (rev 7336) +++ branches/v0_99_maint/examples/pylab_examples/load_converter.py 2009-08-03 19:31:05 UTC (rev 7337) @@ -1,8 +1,9 @@ from matplotlib.dates import strpdate2num -from matplotlib.mlab import load +#from matplotlib.mlab import load +import numpy as np from pylab import figure, show -dates, closes = load( +dates, closes = np.loadtxt( '../data/msft.csv', delimiter=',', converters={0:strpdate2num('%d-%b-%y')}, skiprows=1, usecols=(0,2), unpack=True) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2009-08-03 19:41:43
|
Revision: 7338 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7338&view=rev Author: jouni Date: 2009-08-03 19:41:32 +0000 (Mon, 03 Aug 2009) Log Message: ----------- Fixed boilerplate.py so it doesn't break the ReST docs. Modified Paths: -------------- branches/v0_99_maint/CHANGELOG branches/v0_99_maint/boilerplate.py branches/v0_99_maint/lib/matplotlib/pyplot.py Modified: branches/v0_99_maint/CHANGELOG =================================================================== --- branches/v0_99_maint/CHANGELOG 2009-08-03 19:31:05 UTC (rev 7337) +++ branches/v0_99_maint/CHANGELOG 2009-08-03 19:41:32 UTC (rev 7338) @@ -1,3 +1,5 @@ +2009-08-03 Fixed boilerplate.py so it doesn't break the ReST docs. - JKS + ====================================================================== 2009-07-31 Tagging 0.99.0.rc1 at 7314 - MGD Modified: branches/v0_99_maint/boilerplate.py =================================================================== --- branches/v0_99_maint/boilerplate.py 2009-08-03 19:31:05 UTC (rev 7337) +++ branches/v0_99_maint/boilerplate.py 2009-08-03 19:41:32 UTC (rev 7338) @@ -21,7 +21,6 @@ # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def %(func)s(%(argspec)s): - %(docstring)s %(ax)s = gca() # allow callers to override the hold state by passing hold=True|False %(washold)s = %(ax)s.ishold() @@ -35,16 +34,19 @@ %(ax)s.hold(%(washold)s) %(mappable)s return %(ret)s +if Axes.%(func)s.__doc__ is not None: + %(func)s.__doc__ = dedent(Axes.%(func)s.__doc__) + __docstring_addendum """ _fmtmisc = """\ # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def %(func)s(%(argspec)s): - %(docstring)s %(ret)s = gca().%(func)s(%(call)s) draw_if_interactive() return %(ret)s +if Axes.%(func)s.__doc__ is not None: + %(func)s.__doc__ = dedent(Axes.%(func)s.__doc__) """ # these methods are all simple wrappers of Axes methods by the same @@ -138,19 +140,6 @@ """ return '\n'.join(x.rstrip() for x in string.split('\n')) -def make_docstring(cmd, mention_hold): - func = getattr(Axes, cmd) - docstring = inspect.getdoc(func) - if docstring is None: - return "" - escaped = re.sub(r'\\', r'\\\\', docstring) - if mention_hold: - escaped += ''' - -Additional kwargs: hold = [True|False] overrides default hold state -''' - return '"""'+escaped+'"""' - for fmt,cmdlist in (_fmtplot,_plotcommands),(_fmtmisc,_misccommands): for func in cmdlist: # For some commands, an additional line is needed to set the @@ -160,9 +149,6 @@ else: mappable = '' - # Format docstring - docstring = make_docstring(func, fmt is _fmtplot) - # Get argspec of wrapped function args, varargs, varkw, defaults = inspect.getargspec(getattr(Axes, func)) args.pop(0) # remove 'self' argument Modified: branches/v0_99_maint/lib/matplotlib/pyplot.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/pyplot.py 2009-08-03 19:31:05 UTC (rev 7337) +++ branches/v0_99_maint/lib/matplotlib/pyplot.py 2009-08-03 19:41:32 UTC (rev 7338) @@ -1608,72 +1608,17 @@ draw_if_interactive() +# This is added to docstrings of autogenerated plotting functions +__docstring_addendum = """ + +Additional kwargs: hold = [True|False] overrides default hold state""" + ## Plotting part 2: autogenerated wrappers for axes methods ## # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def acorr(x, hold=None, **kwargs): - """call signature:: - - acorr(x, normed=True, detrend=mlab.detrend_none, usevlines=True, - maxlags=10, **kwargs) - -Plot the autocorrelation of *x*. If *normed* = *True*, -normalize the data by the autocorrelation at 0-th lag. *x* is -detrended by the *detrend* callable (default no normalization). - -Data are plotted as ``plot(lags, c, **kwargs)`` - -Return value is a tuple (*lags*, *c*, *line*) where: - - - *lags* are a length 2*maxlags+1 lag vector - - - *c* is the 2*maxlags+1 auto correlation vector - - - *line* is a :class:`~matplotlib.lines.Line2D` instance - returned by :meth:`plot` - -The default *linestyle* is None and the default *marker* is -``'o'``, though these can be overridden with keyword args. -The cross correlation is performed with -:func:`numpy.correlate` with *mode* = 2. - -If *usevlines* is *True*, :meth:`~matplotlib.axes.Axes.vlines` -rather than :meth:`~matplotlib.axes.Axes.plot` is used to draw -vertical lines from the origin to the acorr. Otherwise, the -plot style is determined by the kwargs, which are -:class:`~matplotlib.lines.Line2D` properties. - -*maxlags* is a positive integer detailing the number of lags -to show. The default value of *None* will return all -:math:`2 \\mathrm{len}(x) - 1` lags. - -The return value is a tuple (*lags*, *c*, *linecol*, *b*) -where - -- *linecol* is the - :class:`~matplotlib.collections.LineCollection` - -- *b* is the *x*-axis. - -.. seealso:: - - :meth:`~matplotlib.axes.Axes.plot` or - :meth:`~matplotlib.axes.Axes.vlines` - For documentation on valid kwargs. - -**Example:** - -:func:`~matplotlib.pyplot.xcorr` above, and -:func:`~matplotlib.pyplot.acorr` below. - -**Example:** - -.. plot:: mpl_examples/pylab_examples/xcorr_demo.py - -Additional kwargs: hold = [True|False] overrides default hold state -""" ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -1687,51 +1632,12 @@ ax.hold(washold) return ret +if Axes.acorr.__doc__ is not None: + acorr.__doc__ = dedent(Axes.acorr.__doc__) + __docstring_addendum # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def arrow(x, y, dx, dy, hold=None, **kwargs): - """call signature:: - - arrow(x, y, dx, dy, **kwargs) - -Draws arrow on specified axis from (*x*, *y*) to (*x* + *dx*, -*y* + *dy*). - -Optional kwargs control the arrow properties: - alpha: float (0.0 transparent through 1.0 opaque) - animated: [True | False] - antialiased or aa: [True | False] or None for default - axes: an :class:`~matplotlib.axes.Axes` instance - clip_box: a :class:`matplotlib.transforms.Bbox` instance - clip_on: [True | False] - clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ] - color: matplotlib color arg or sequence of rgba tuples - contains: a callable function - edgecolor or ec: mpl color spec, or None for default, or 'none' for no color - facecolor or fc: mpl color spec, or None for default, or 'none' for no color - figure: a :class:`matplotlib.figure.Figure` instance - fill: [True | False] - gid: an id string - hatch: [ '/' | '\\\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ] - label: any string - linestyle or ls: ['solid' | 'dashed' | 'dashdot' | 'dotted'] - linewidth or lw: float or None for default - lod: [True | False] - picker: [None|float|boolean|callable] - rasterized: [True | False | None] - snap: unknown - transform: :class:`~matplotlib.transforms.Transform` instance - url: a url string - visible: [True | False] - zorder: any number - -**Example:** - -.. plot:: mpl_examples/pylab_examples/arrow_demo.py - -Additional kwargs: hold = [True|False] overrides default hold state -""" ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -1745,90 +1651,12 @@ ax.hold(washold) return ret +if Axes.arrow.__doc__ is not None: + arrow.__doc__ = dedent(Axes.arrow.__doc__) + __docstring_addendum # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def axhline(y=0, xmin=0, xmax=1, hold=None, **kwargs): - """call signature:: - - axhline(y=0, xmin=0, xmax=1, **kwargs) - -Axis Horizontal Line - -Draw a horizontal line at *y* from *xmin* to *xmax*. With the -default values of *xmin* = 0 and *xmax* = 1, this line will -always span the horizontal extent of the axes, regardless of -the xlim settings, even if you change them, eg. with the -:meth:`set_xlim` command. That is, the horizontal extent is -in axes coords: 0=left, 0.5=middle, 1.0=right but the *y* -location is in data coordinates. - -Return value is the :class:`~matplotlib.lines.Line2D` -instance. kwargs are the same as kwargs to plot, and can be -used to control the line properties. Eg., - -* draw a thick red hline at *y* = 0 that spans the xrange - - >>> axhline(linewidth=4, color='r') - -* draw a default hline at *y* = 1 that spans the xrange - - >>> axhline(y=1) - -* draw a default hline at *y* = .5 that spans the the middle half of - the xrange - - >>> axhline(y=.5, xmin=0.25, xmax=0.75) - -Valid kwargs are :class:`~matplotlib.lines.Line2D` properties: - - alpha: float (0.0 transparent through 1.0 opaque) - animated: [True | False] - antialiased or aa: [True | False] - axes: an :class:`~matplotlib.axes.Axes` instance - clip_box: a :class:`matplotlib.transforms.Bbox` instance - clip_on: [True | False] - clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ] - color or c: any matplotlib color - contains: a callable function - dash_capstyle: ['butt' | 'round' | 'projecting'] - dash_joinstyle: ['miter' | 'round' | 'bevel'] - dashes: sequence of on/off ink in points - data: 2D array - drawstyle: [ 'default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post' ] - figure: a :class:`matplotlib.figure.Figure` instance - fillstyle: ['full' | 'left' | 'right' | 'bottom' | 'top'] - gid: an id string - label: any string - linestyle or ls: [ '-' | '--' | '-.' | ':' | 'None' | ' ' | '' ] and any drawstyle in combination with a linestyle, e.g. 'steps--'. - linewidth or lw: float value in points - lod: [True | False] - marker: [ '+' | '*' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|' | TICKUP | TICKDOWN | TICKLEFT | TICKRIGHT | 'None' | ' ' | '' ] - markeredgecolor or mec: any matplotlib color - markeredgewidth or mew: float value in points - markerfacecolor or mfc: any matplotlib color - markersize or ms: float - markevery: None | integer | (startind, stride) - picker: float distance in points or callable pick function ``fn(artist, event)`` - pickradius: float distance in points - rasterized: [True | False | None] - snap: unknown - solid_capstyle: ['butt' | 'round' | 'projecting'] - solid_joinstyle: ['miter' | 'round' | 'bevel'] - transform: a :class:`matplotlib.transforms.Transform` instance - url: a url string - visible: [True | False] - xdata: 1D array - ydata: 1D array - zorder: any number - -.. seealso:: - - :meth:`axhspan` - for example plot and source code - -Additional kwargs: hold = [True|False] overrides default hold state -""" ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -1842,72 +1670,12 @@ ax.hold(washold) return ret +if Axes.axhline.__doc__ is not None: + axhline.__doc__ = dedent(Axes.axhline.__doc__) + __docstring_addendum # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def axhspan(ymin, ymax, xmin=0, xmax=1, hold=None, **kwargs): - """call signature:: - - axhspan(ymin, ymax, xmin=0, xmax=1, **kwargs) - -Axis Horizontal Span. - -*y* coords are in data units and *x* coords are in axes (relative -0-1) units. - -Draw a horizontal span (rectangle) from *ymin* to *ymax*. -With the default values of *xmin* = 0 and *xmax* = 1, this -always spans the xrange, regardless of the xlim settings, even -if you change them, eg. with the :meth:`set_xlim` command. -That is, the horizontal extent is in axes coords: 0=left, -0.5=middle, 1.0=right but the *y* location is in data -coordinates. - -Return value is a :class:`matplotlib.patches.Polygon` -instance. - -Examples: - -* draw a gray rectangle from *y* = 0.25-0.75 that spans the - horizontal extent of the axes - - >>> axhspan(0.25, 0.75, facecolor='0.5', alpha=0.5) - -Valid kwargs are :class:`~matplotlib.patches.Polygon` properties: - - alpha: float (0.0 transparent through 1.0 opaque) - animated: [True | False] - antialiased or aa: [True | False] or None for default - axes: an :class:`~matplotlib.axes.Axes` instance - clip_box: a :class:`matplotlib.transforms.Bbox` instance - clip_on: [True | False] - clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ] - color: matplotlib color arg or sequence of rgba tuples - contains: a callable function - edgecolor or ec: mpl color spec, or None for default, or 'none' for no color - facecolor or fc: mpl color spec, or None for default, or 'none' for no color - figure: a :class:`matplotlib.figure.Figure` instance - fill: [True | False] - gid: an id string - hatch: [ '/' | '\\\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ] - label: any string - linestyle or ls: ['solid' | 'dashed' | 'dashdot' | 'dotted'] - linewidth or lw: float or None for default - lod: [True | False] - picker: [None|float|boolean|callable] - rasterized: [True | False | None] - snap: unknown - transform: :class:`~matplotlib.transforms.Transform` instance - url: a url string - visible: [True | False] - zorder: any number - -**Example:** - -.. plot:: mpl_examples/pylab_examples/axhspan_demo.py - -Additional kwargs: hold = [True|False] overrides default hold state -""" ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -1921,90 +1689,12 @@ ax.hold(washold) return ret +if Axes.axhspan.__doc__ is not None: + axhspan.__doc__ = dedent(Axes.axhspan.__doc__) + __docstring_addendum # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def axvline(x=0, ymin=0, ymax=1, hold=None, **kwargs): - """call signature:: - - axvline(x=0, ymin=0, ymax=1, **kwargs) - -Axis Vertical Line - -Draw a vertical line at *x* from *ymin* to *ymax*. With the -default values of *ymin* = 0 and *ymax* = 1, this line will -always span the vertical extent of the axes, regardless of the -ylim settings, even if you change them, eg. with the -:meth:`set_ylim` command. That is, the vertical extent is in -axes coords: 0=bottom, 0.5=middle, 1.0=top but the *x* location -is in data coordinates. - -Return value is the :class:`~matplotlib.lines.Line2D` -instance. kwargs are the same as kwargs to plot, and can be -used to control the line properties. Eg., - -* draw a thick red vline at *x* = 0 that spans the yrange - - >>> axvline(linewidth=4, color='r') - -* draw a default vline at *x* = 1 that spans the yrange - - >>> axvline(x=1) - -* draw a default vline at *x* = .5 that spans the the middle half of - the yrange - - >>> axvline(x=.5, ymin=0.25, ymax=0.75) - -Valid kwargs are :class:`~matplotlib.lines.Line2D` properties: - - alpha: float (0.0 transparent through 1.0 opaque) - animated: [True | False] - antialiased or aa: [True | False] - axes: an :class:`~matplotlib.axes.Axes` instance - clip_box: a :class:`matplotlib.transforms.Bbox` instance - clip_on: [True | False] - clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ] - color or c: any matplotlib color - contains: a callable function - dash_capstyle: ['butt' | 'round' | 'projecting'] - dash_joinstyle: ['miter' | 'round' | 'bevel'] - dashes: sequence of on/off ink in points - data: 2D array - drawstyle: [ 'default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post' ] - figure: a :class:`matplotlib.figure.Figure` instance - fillstyle: ['full' | 'left' | 'right' | 'bottom' | 'top'] - gid: an id string - label: any string - linestyle or ls: [ '-' | '--' | '-.' | ':' | 'None' | ' ' | '' ] and any drawstyle in combination with a linestyle, e.g. 'steps--'. - linewidth or lw: float value in points - lod: [True | False] - marker: [ '+' | '*' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|' | TICKUP | TICKDOWN | TICKLEFT | TICKRIGHT | 'None' | ' ' | '' ] - markeredgecolor or mec: any matplotlib color - markeredgewidth or mew: float value in points - markerfacecolor or mfc: any matplotlib color - markersize or ms: float - markevery: None | integer | (startind, stride) - picker: float distance in points or callable pick function ``fn(artist, event)`` - pickradius: float distance in points - rasterized: [True | False | None] - snap: unknown - solid_capstyle: ['butt' | 'round' | 'projecting'] - solid_joinstyle: ['miter' | 'round' | 'bevel'] - transform: a :class:`matplotlib.transforms.Transform` instance - url: a url string - visible: [True | False] - xdata: 1D array - ydata: 1D array - zorder: any number - -.. seealso:: - - :meth:`axhspan` - for example plot and source code - -Additional kwargs: hold = [True|False] overrides default hold state -""" ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -2018,73 +1708,12 @@ ax.hold(washold) return ret +if Axes.axvline.__doc__ is not None: + axvline.__doc__ = dedent(Axes.axvline.__doc__) + __docstring_addendum # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def axvspan(xmin, xmax, ymin=0, ymax=1, hold=None, **kwargs): - """call signature:: - - axvspan(xmin, xmax, ymin=0, ymax=1, **kwargs) - -Axis Vertical Span. - -*x* coords are in data units and *y* coords are in axes (relative -0-1) units. - -Draw a vertical span (rectangle) from *xmin* to *xmax*. With -the default values of *ymin* = 0 and *ymax* = 1, this always -spans the yrange, regardless of the ylim settings, even if you -change them, eg. with the :meth:`set_ylim` command. That is, -the vertical extent is in axes coords: 0=bottom, 0.5=middle, -1.0=top but the *y* location is in data coordinates. - -Return value is the :class:`matplotlib.patches.Polygon` -instance. - -Examples: - -* draw a vertical green translucent rectangle from x=1.25 to 1.55 that - spans the yrange of the axes - - >>> axvspan(1.25, 1.55, facecolor='g', alpha=0.5) - -Valid kwargs are :class:`~matplotlib.patches.Polygon` -properties: - - alpha: float (0.0 transparent through 1.0 opaque) - animated: [True | False] - antialiased or aa: [True | False] or None for default - axes: an :class:`~matplotlib.axes.Axes` instance - clip_box: a :class:`matplotlib.transforms.Bbox` instance - clip_on: [True | False] - clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ] - color: matplotlib color arg or sequence of rgba tuples - contains: a callable function - edgecolor or ec: mpl color spec, or None for default, or 'none' for no color - facecolor or fc: mpl color spec, or None for default, or 'none' for no color - figure: a :class:`matplotlib.figure.Figure` instance - fill: [True | False] - gid: an id string - hatch: [ '/' | '\\\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ] - label: any string - linestyle or ls: ['solid' | 'dashed' | 'dashdot' | 'dotted'] - linewidth or lw: float or None for default - lod: [True | False] - picker: [None|float|boolean|callable] - rasterized: [True | False | None] - snap: unknown - transform: :class:`~matplotlib.transforms.Transform` instance - url: a url string - visible: [True | False] - zorder: any number - -.. seealso:: - - :meth:`axhspan` - for example plot and source code - -Additional kwargs: hold = [True|False] overrides default hold state -""" ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -2098,110 +1727,12 @@ ax.hold(washold) return ret +if Axes.axvspan.__doc__ is not None: + axvspan.__doc__ = dedent(Axes.axvspan.__doc__) + __docstring_addendum # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def bar(left, height, width=0.80000000000000004, bottom=None, color=None, edgecolor=None, linewidth=None, yerr=None, xerr=None, ecolor=None, capsize=3, align='edge', orientation='vertical', log=False, hold=None, **kwargs): - """call signature:: - - bar(left, height, width=0.8, bottom=0, - color=None, edgecolor=None, linewidth=None, - yerr=None, xerr=None, ecolor=None, capsize=3, - align='edge', orientation='vertical', log=False) - -Make a bar plot with rectangles bounded by: - - *left*, *left* + *width*, *bottom*, *bottom* + *height* - (left, right, bottom and top edges) - -*left*, *height*, *width*, and *bottom* can be either scalars -or sequences - -Return value is a list of -:class:`matplotlib.patches.Rectangle` instances. - -Required arguments: - - ======== =============================================== - Argument Description - ======== =============================================== - *left* the x coordinates of the left sides of the bars - *height* the heights of the bars - ======== =============================================== - -Optional keyword arguments: - - =============== ========================================== - Keyword Description - =============== ========================================== - *width* the widths of the bars - *bottom* the y coordinates of the bottom edges of - the bars - *color* the colors of the bars - *edgecolor* the colors of the bar edges - *linewidth* width of bar edges; None means use default - linewidth; 0 means don't draw edges. - *xerr* if not None, will be used to generate - errorbars on the bar chart - *yerr* if not None, will be used to generate - errorbars on the bar chart - *ecolor* specifies the color of any errorbar - *capsize* (default 3) determines the length in - points of the error bar caps - *align* 'edge' (default) | 'center' - *orientation* 'vertical' | 'horizontal' - *log* [False|True] False (default) leaves the - orientation axis as-is; True sets it to - log scale - =============== ========================================== - -For vertical bars, *align* = 'edge' aligns bars by their left -edges in left, while *align* = 'center' interprets these -values as the *x* coordinates of the bar centers. For -horizontal bars, *align* = 'edge' aligns bars by their bottom -edges in bottom, while *align* = 'center' interprets these -values as the *y* coordinates of the bar centers. - -The optional arguments *color*, *edgecolor*, *linewidth*, -*xerr*, and *yerr* can be either scalars or sequences of -length equal to the number of bars. This enables you to use -bar as the basis for stacked bar charts, or candlestick plots. - -Other optional kwargs: - - alpha: float (0.0 transparent through 1.0 opaque) - animated: [True | False] - antialiased or aa: [True | False] or None for default - axes: an :class:`~matplotlib.axes.Axes` instance - clip_box: a :class:`matplotlib.transforms.Bbox` instance - clip_on: [True | False] - clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ] - color: matplotlib color arg or sequence of rgba tuples - contains: a callable function - edgecolor or ec: mpl color spec, or None for default, or 'none' for no color - facecolor or fc: mpl color spec, or None for default, or 'none' for no color - figure: a :class:`matplotlib.figure.Figure` instance - fill: [True | False] - gid: an id string - hatch: [ '/' | '\\\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ] - label: any string - linestyle or ls: ['solid' | 'dashed' | 'dashdot' | 'dotted'] - linewidth or lw: float or None for default - lod: [True | False] - picker: [None|float|boolean|callable] - rasterized: [True | False | None] - snap: unknown - transform: :class:`~matplotlib.transforms.Transform` instance - url: a url string - visible: [True | False] - zorder: any number - -**Example:** A stacked bar chart. - -.. plot:: mpl_examples/pylab_examples/bar_stacked.py - -Additional kwargs: hold = [True|False] overrides default hold state -""" ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -2215,100 +1746,12 @@ ax.hold(washold) return ret +if Axes.bar.__doc__ is not None: + bar.__doc__ = dedent(Axes.bar.__doc__) + __docstring_addendum # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def barh(bottom, width, height=0.80000000000000004, left=None, hold=None, **kwargs): - """call signature:: - - barh(bottom, width, height=0.8, left=0, **kwargs) - -Make a horizontal bar plot with rectangles bounded by: - - *left*, *left* + *width*, *bottom*, *bottom* + *height* - (left, right, bottom and top edges) - -*bottom*, *width*, *height*, and *left* can be either scalars -or sequences - -Return value is a list of -:class:`matplotlib.patches.Rectangle` instances. - -Required arguments: - - ======== ====================================================== - Argument Description - ======== ====================================================== - *bottom* the vertical positions of the bottom edges of the bars - *width* the lengths of the bars - ======== ====================================================== - -Optional keyword arguments: - - =============== ========================================== - Keyword Description - =============== ========================================== - *height* the heights (thicknesses) of the bars - *left* the x coordinates of the left edges of the - bars - *color* the colors of the bars - *edgecolor* the colors of the bar edges - *linewidth* width of bar edges; None means use default - linewidth; 0 means don't draw edges. - *xerr* if not None, will be used to generate - errorbars on the bar chart - *yerr* if not None, will be used to generate - errorbars on the bar chart - *ecolor* specifies the color of any errorbar - *capsize* (default 3) determines the length in - points of the error bar caps - *align* 'edge' (default) | 'center' - *log* [False|True] False (default) leaves the - horizontal axis as-is; True sets it to log - scale - =============== ========================================== - -Setting *align* = 'edge' aligns bars by their bottom edges in -bottom, while *align* = 'center' interprets these values as -the *y* coordinates of the bar centers. - -The optional arguments *color*, *edgecolor*, *linewidth*, -*xerr*, and *yerr* can be either scalars or sequences of -length equal to the number of bars. This enables you to use -barh as the basis for stacked bar charts, or candlestick -plots. - -other optional kwargs: - - alpha: float (0.0 transparent through 1.0 opaque) - animated: [True | False] - antialiased or aa: [True | False] or None for default - axes: an :class:`~matplotlib.axes.Axes` instance - clip_box: a :class:`matplotlib.transforms.Bbox` instance - clip_on: [True | False] - clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ] - color: matplotlib color arg or sequence of rgba tuples - contains: a callable function - edgecolor or ec: mpl color spec, or None for default, or 'none' for no color - facecolor or fc: mpl color spec, or None for default, or 'none' for no color - figure: a :class:`matplotlib.figure.Figure` instance - fill: [True | False] - gid: an id string - hatch: [ '/' | '\\\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ] - label: any string - linestyle or ls: ['solid' | 'dashed' | 'dashdot' | 'dotted'] - linewidth or lw: float or None for default - lod: [True | False] - picker: [None|float|boolean|callable] - rasterized: [True | False | None] - snap: unknown - transform: :class:`~matplotlib.transforms.Transform` instance - url: a url string - visible: [True | False] - zorder: any number - -Additional kwargs: hold = [True|False] overrides default hold state -""" ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -2322,77 +1765,12 @@ ax.hold(washold) return ret +if Axes.barh.__doc__ is not None: + barh.__doc__ = dedent(Axes.barh.__doc__) + __docstring_addendum # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def broken_barh(xranges, yrange, hold=None, **kwargs): - """call signature:: - - broken_barh(self, xranges, yrange, **kwargs) - -A collection of horizontal bars spanning *yrange* with a sequence of -*xranges*. - -Required arguments: - - ========= ============================== - Argument Description - ========= ============================== - *xranges* sequence of (*xmin*, *xwidth*) - *yrange* sequence of (*ymin*, *ywidth*) - ========= ============================== - -kwargs are -:class:`matplotlib.collections.BrokenBarHCollection` -properties: - - alpha: float - animated: [True | False] - antialiased or antialiaseds: Boolean or sequence of booleans - array: unknown - axes: an :class:`~matplotlib.axes.Axes` instance - clim: a length 2 sequence of floats - clip_box: a :class:`matplotlib.transforms.Bbox` instance - clip_on: [True | False] - clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ] - cmap: a colormap - color: matplotlib color arg or sequence of rgba tuples - colorbar: unknown - contains: a callable function - edgecolor or edgecolors: matplotlib color arg or sequence of rgba tuples - facecolor or facecolors: matplotlib color arg or sequence of rgba tuples - figure: a :class:`matplotlib.figure.Figure` instance - gid: an id string - label: any string - linestyle or linestyles or dashes: ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ] - linewidth or lw or linewidths: float or sequence of floats - lod: [True | False] - norm: unknown - offsets: float or sequence of floats - picker: [None|float|boolean|callable] - pickradius: unknown - rasterized: [True | False | None] - snap: unknown - transform: :class:`~matplotlib.transforms.Transform` instance - url: a url string - urls: unknown - visible: [True | False] - zorder: any number - -these can either be a single argument, ie:: - - facecolors = 'black' - -or a sequence of arguments for the various bars, ie:: - - facecolors = ('black', 'red', 'green') - -**Example:** - -.. plot:: mpl_examples/pylab_examples/broken_barh.py - -Additional kwargs: hold = [True|False] overrides default hold state -""" ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -2406,55 +1784,12 @@ ax.hold(washold) return ret +if Axes.broken_barh.__doc__ is not None: + broken_barh.__doc__ = dedent(Axes.broken_barh.__doc__) + __docstring_addendum # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def boxplot(x, notch=0, sym='b+', vert=1, whis=1.5, positions=None, widths=None, hold=None): - """call signature:: - - boxplot(x, notch=0, sym='+', vert=1, whis=1.5, - positions=None, widths=None) - -Make a box and whisker plot for each column of *x* or each -vector in sequence *x*. The box extends from the lower to -upper quartile values of the data, with a line at the median. -The whiskers extend from the box to show the range of the -data. Flier points are those past the end of the whiskers. - -- *notch* = 0 (default) produces a rectangular box plot. -- *notch* = 1 will produce a notched box plot - -*sym* (default 'b+') is the default symbol for flier points. -Enter an empty string ('') if you don't want to show fliers. - -- *vert* = 1 (default) makes the boxes vertical. -- *vert* = 0 makes horizontal boxes. This seems goofy, but - that's how Matlab did it. - -*whis* (default 1.5) defines the length of the whiskers as -a function of the inner quartile range. They extend to the -most extreme data point within ( ``whis*(75%-25%)`` ) data range. - -*positions* (default 1,2,...,n) sets the horizontal positions of -the boxes. The ticks and limits are automatically set to match -the positions. - -*widths* is either a scalar or a vector and sets the width of -each box. The default is 0.5, or ``0.15*(distance between extreme -positions)`` if that is smaller. - -*x* is an array or a sequence of vectors. - -Returns a dictionary mapping each component of the boxplot -to a list of the :class:`matplotlib.lines.Line2D` -instances created. - -**Example:** - -.. plot:: pyplots/boxplot_demo.py - -Additional kwargs: hold = [True|False] overrides default hold state -""" ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -2468,145 +1803,12 @@ ax.hold(washold) return ret +if Axes.boxplot.__doc__ is not None: + boxplot.__doc__ = dedent(Axes.boxplot.__doc__) + __docstring_addendum # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def cohere(x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none, window=mlab.window_hanning, noverlap=0, pad_to=None, sides='default', scale_by_freq=None, hold=None, **kwargs): - """call signature:: - - cohere(x, y, NFFT=256, Fs=2, Fc=0, detrend = mlab.detrend_none, - window = mlab.window_hanning, noverlap=0, pad_to=None, - sides='default', scale_by_freq=None, **kwargs) - -cohere the coherence between *x* and *y*. Coherence is the normalized -cross spectral density: - -.. math:: - - C_{xy} = \\frac{|P_{xy}|^2}{P_{xx}P_{yy}} - -Keyword arguments: - - *NFFT*: integer - The number of data points used in each block for the FFT. - Must be even; a power 2 is most efficient. The default value is 256. - - *Fs*: scalar - The sampling frequency (samples per time unit). It is used - to calculate the Fourier frequencies, freqs, in cycles per time - unit. The default value is 2. - - *detrend*: callable - The function applied to each segment before fft-ing, - designed to remove the mean or linear trend. Unlike in - matlab, where the *detrend* parameter is a vector, in - matplotlib is it a function. The :mod:`~matplotlib.pylab` - module defines :func:`~matplotlib.pylab.detrend_none`, - :func:`~matplotlib.pylab.detrend_mean`, and - :func:`~matplotlib.pylab.detrend_linear`, but you can use - a custom function as well. - - *window*: callable or ndarray - A function or a vector of length *NFFT*. To create window - vectors see :func:`window_hanning`, :func:`window_none`, - :func:`numpy.blackman`, :func:`numpy.hamming`, - :func:`numpy.bartlett`, :func:`scipy.signal`, - :func:`scipy.signal.get_window`, etc. The default is - :func:`window_hanning`. If a function is passed as the - argument, it must take a data segment as an argument and - return the windowed version of the segment. - - *noverlap*: integer - The number of points of overlap between blocks. The default value - is 0 (no overlap). - - *pad_to*: integer - The number of points to which the data segment is padded when - performing the FFT. This can be different from *NFFT*, which - specifies the number of data points used. While not increasing - the actual resolution of the psd (the minimum distance between - resolvable peaks), this can give more points in the plot, - allowing for more detail. This corresponds to the *n* parameter - in the call to fft(). The default is None, which sets *pad_to* - equal to *NFFT* - - *sides*: [ 'default' | 'onesided' | 'twosided' ] - Specifies which sides of the PSD to return. Default gives the - default behavior, which returns one-sided for real data and both - for complex data. 'onesided' forces the return of a one-sided PSD, - while 'twosided' forces two-sided. - - *scale_by_freq*: boolean - Specifies whether the resulting density values should be scaled - by the scaling frequency, which gives density in units of Hz^-1. - This allows for integration over the returned frequency values. - The default is True for MatLab compatibility. - - *Fc*: integer - The center frequency of *x* (defaults to 0), which offsets - the x extents of the plot to reflect the frequency range used - when a signal is acquired and then filtered and downsampled to - baseband. - -The return value is a tuple (*Cxy*, *f*), where *f* are the -frequencies of the coherence vector. - -kwargs are applied to the lines. - -References: - - * Bendat & Piersol -- Random Data: Analysis and Measurement - Procedures, John Wiley & Sons (1986) - -kwargs control the :class:`~matplotlib.lines.Line2D` -properties of the coherence plot: - - alpha: float (0.0 transparent through 1.0 opaque) - animated: [True | False] - antialiased or aa: [True | False] - axes: an :class:`~matplotlib.axes.Axes` instance - clip_box: a :class:`matplotlib.transforms.Bbox` instance - clip_on: [True | False] - clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ] - color or c: any matplotlib color - contains: a callable function - dash_capstyle: ['butt' | 'round' | 'projecting'] - dash_joinstyle: ['miter' | 'round' | 'bevel'] - dashes: sequence of on/off ink in points - data: 2D array - drawstyle: [ 'default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post' ] - figure: a :class:`matplotlib.figure.Figure` instance - fillstyle: ['full' | 'left' | 'right' | 'bottom' | 'top'] - gid: an id string - label: any string - linestyle or ls: [ '-' | '--' | '-.' | ':' | 'None' | ' ' | '' ] and any drawstyle in combination with a linestyle, e.g. 'steps--'. - linewidth or lw: float value in points - lod: [True | False] - marker: [ '+' | '*' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|' | TICKUP | TICKDOWN | TICKLEFT | TICKRIGHT | 'None' | ' ' | '' ] - markeredgecolor or mec: any matplotlib color - markeredgewidth or mew: float value in points - markerfacecolor or mfc: any matplotlib color - markersize or ms: float - markevery: None | integer | (startind, stride) - picker: float distance in points or callable pick function ``fn(artist, event)`` - pickradius: float distance in points - rasterized: [True | False | None] - snap: unknown - solid_capstyle: ['butt' | 'round' | 'projecting'] - solid_joinstyle: ['miter' | 'round' | 'bevel'] - transform: a :class:`matplotlib.transforms.Transform` instance - url: a url string - visible: [True | False] - xdata: 1D array - ydata: 1D array - zorder: any number - -**Example:** - -.. plot:: mpl_examples/pylab_examples/cohere_demo.py - -Additional kwargs: hold = [True|False] overrides default hold state -""" ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -2620,75 +1822,12 @@ ax.hold(washold) return ret +if Axes.cohere.__doc__ is not None: + cohere.__doc__ = dedent(Axes.cohere.__doc__) + __docstring_addendum # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def clabel(CS, *args, **kwargs): - """call signature:: - - clabel(cs, **kwargs) - -adds labels to line contours in *cs*, where *cs* is a -:class:`~matplotlib.contour.ContourSet` object returned by -contour. - -:: - - clabel(cs, v, **kwargs) - -only labels contours listed in *v*. - -Optional keyword arguments: - - *fontsize*: - See http://matplotlib.sf.net/fonts.html - - *colors*: - - if *None*, the color of each label matches the color of - the corresponding contour - - - if one string color, e.g. *colors* = 'r' or *colors* = - 'red', all labels will be plotted in this color - - - if a tuple of matplotlib color args (string, float, rgb, etc), - different labels will be plotted in different colors in the order - specified - - *inline*: - controls whether the underlying contour is removed or - not. Default is *True*. - - *inline_spacing*: - space in pixels to leave on each side of label when - placing inline. Defaults to 5. This spacing will be - exact for labels at locations where the contour is - straight, less so for labels on curved contours. - - *fmt*: - a format string for the label. Default is '%1.3f' - Alternatively, this can be a dictionary matching contour - levels with arbitrary strings to use for each contour level - (i.e., fmt[level]=string) - - *manual*: - if *True*, contour labels will be placed manually using - mouse clicks. Click the first button near a contour to - add a label, click the second button (or potentially both - mouse buttons at once) to finish adding labels. The third - button can be used to remove the last label added, but - only if labels are not inline. Alternatively, the keyboard - can be used to select label locations (enter to end label - placement, delete or backspace act like the third mouse button, - and any other key will select a label location). - - *rightside_up*: - if *True* (default), label rotations will always be plus - or minus 90 degrees from level. - -.. plot:: mpl_examples/pylab_examples/contour_demo.py - -Additional kwargs: hold = [True|False] overrides default hold state -""" ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -2702,172 +1841,12 @@ ax.hold(washold) return ret +if Axes.clabel.__doc__ is not None: + clabel.__doc__ = dedent(Axes.clabel.__doc__) + __docstring_addendum # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def contour(*args, **kwargs): - """:func:`~matplotlib.pyplot.contour` and -:func:`~matplotlib.pyplot.contourf` draw contour lines and -filled contours, respectively. Except as noted, function -signatures and return values are the same for both versions. - -:func:`~matplotlib.pyplot.contourf` differs from the Matlab -(TM) version in that it does not draw the polygon edges, -because the contouring engine yields simply connected regions -with branch cuts. To draw the edges, add line contours with -calls to :func:`~matplotlib.pyplot.contour`. - - -call signatures:: - - contour(Z) - -make a contour plot of an array *Z*. The level values are chosen -automatically. - -:: - - contour(X,Y,Z) - -*X*, *Y* specify the (*x*, *y*) coordinates of the surface - -:: - - contour(Z,N) - contour(X,Y,Z,N) - -contour *N* automatically-chosen levels. - -:: - - contour(Z,V) - contour(X,Y,Z,V) - -draw contour lines at the values specified in sequence *V* - -:: - - contourf(..., V) - -fill the (len(*V*)-1) regions between the values in *V* - -:: - - contour(Z, **kwargs) - -Use keyword args to control colors, linewidth, origin, cmap ... see -below for more details. - -*X*, *Y*, and *Z* must be arrays with the same dimensions. - -*Z* may be a masked array, but filled contouring may not -handle internal masked regions correctly. - -``C = contour(...)`` returns a -:class:`~matplotlib.contour.ContourSet` object. - -Optional keyword arguments: - - *colors*: [ None | string | (mpl_colors) ] - If *None*, the colormap specified by cmap will be used. - - If a string, like 'r' or 'red', all levels will be plotted in this - color. - - If a tuple of matplotlib color args (string, float, rgb, etc), - different levels will be plotted in different colors in the order - specified. - - *alpha*: float - The alpha blending value - - *cmap*: [ None | Colormap ] - A cm :class:`~matplotlib.cm.Colormap` instance or - *None*. If *cmap* is *None* and *colors* is *None*, a - default Colormap is used. - - *norm*: [ None | Normalize ] - A :class:`matplotlib.colors.Normalize` instance for - scaling data values to colors. If *norm* is *None* and - *colors* is *None*, the default linear scaling is used. - - *origin*: [ None | 'upper' | 'lower' | 'image' ] - If *None*, the first value of *Z* will correspond to the - lower left corner, location (0,0). If 'image', the rc - value for ``image.origin`` will be used. - - This keyword is not active if *X* and *Y* are specified in - the call to contour. - - *extent*: [ None | (x0,x1,y0,y1) ] - - If *origin* is not *None*, then *extent* is interpreted as - in :func:`matplotlib.pyplot.imshow`: it gives the outer - pixel boundaries. In this case, the position of Z[0,0] - is the center of the pixel, not a corner. If *origin* is - *None*, then (*x0*, *y0*) is the position of Z[0,0], and - (*x1*, *y1*) is the position of Z[-1,-1]. - - This keyword is not active if *X* and *Y* are specified in - the call to contour. - - *locator*: [ None | ticker.Locator subclass ] - If *locator* is None, the default - :class:`~matplotlib.ticker.MaxNLocator` is used. The - locator is used to determine the contour levels if they - are not given explicitly via the *V* argument. - - *extend*: [ 'neither' | 'both' | 'min' | 'max' ] - Unless this is 'neither', contour levels are automatically - added to one or both ends of the range so that all data - are included. These added ranges are then mapped to the - special colormap values which default to the ends of the - colormap range, but can be set via - :meth:`matplotlib.cm.Colormap.set_under` and - :meth:`matplotlib.cm.Colormap.set_over` methods. - -contour-only keyword arguments: - - *linewidths*: [ None | number | tuple of numbers ] - If *linewidths* is *None*, the default width in - ``lines.linewidth`` in ``matplotlibrc`` is used. - - If a number, all levels will be plotted with this linewidth. - - If a tuple, different levels will be plotted with different - linewidths in the order specified - - *linestyles*: [None | 'solid' | 'dashed' | 'dashdot' | 'dotted' ] - If *linestyles* is *None*, the 'solid' is used. - - *linestyles* can also be an iterable of the above strings - specifying a set of linestyles to be used. If this - iterable is shorter than the number of contour levels - it will be repeated as necessary. - - If contour is using a monochrome colormap and the contour - level is less than 0, then the linestyle specified - in ``contour.negative_linestyle`` in ``matplotlibrc`` - will be used. - -contourf-only keyword arguments: - - *antialiased*: [ True | False ] - enable antialiasing - - *nchunk*: [ 0 | integer ] - If 0, no subdivision of the domain. Specify a positive integer to - divide the domain into subdomains of roughly *nchunk* by *nchunk* - points. This may never actually be advantageous, so this option may - be removed. Chunking introduces artifacts at the chunk boundaries - unless *antialiased* is *False*. - -**Example:** - -.. plot:: mpl_examples/pylab_examples/contour_demo.py - -Additional kwargs: hold = [True|False] overrides default hold state -""" ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -2881,172 +1860,12 @@ ax.hold(washold) if ret._A is not None: gci._current = ret return ret +if Axes.contour.__doc__ is not None: + contour.__doc__ = dedent(Axes.contour.__doc__) + __docstring_addendum # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def contourf(*args, **kwargs): - """:func:`~matplotlib.pyplot.contour` and -:func:`~matplotlib.pyplot.contourf` draw contour lines and -filled contours, respectively. Except as noted, function -signatures and return values are the same for both versions. - -:func:`~matplotlib.pyplot.contourf` differs from the Matlab -(TM) version in that it does not draw the polygon edges, -because the contouring engine yields simply connected regions -with branch cuts. To draw the edges, add line contours with -calls to :func:`~matplotlib.pyplot.contour`. - - -call signatures:: - - contour(Z) - -make a contour plot of an array *Z*. The level values are chosen -automatically. - -:: - - contour(X,Y,Z) - -*X*, *Y* specify the (*x*, *y*) coordinates of the surface - -:: - - contour(Z,N) - contour(X,Y,Z,N) - -contour *N* automatically-chosen levels. - -:: - - contour(Z,V) - contour(X,Y,Z,V) - -draw contour lines at the values specified in sequence *V* - -:: - - contourf(..., V) - -fill the (len(*V*)-1) regions between the values in *V* - -:: - - contour(Z, **kwargs) - -Use keyword args to control colors, linewidth, origin, cmap ... see -below for more details. - -*X*, *Y*, and *Z* must be arrays with the same dimensions. - -*Z* may be a masked array, but filled contouring may not -handle internal masked regions correctly. - -``C = contour(...)`` returns a -:class:`~matplotlib.contour.ContourSet` object. - -Optional keyword arguments: - - *colors*: [ None | string | (mpl_colors) ] - If *None*, the colormap specified by cmap will be used. - - If a string, like 'r' or 'red', all levels will be plotted in this - color. - - If a tuple of matplotlib color args (string, float, rgb, etc), - different levels will be plotted in different colors in the order - specified. - - *alpha*: float - The alpha blending value - - *cmap*: [ None | Colormap ] - A cm :class:`~matplotlib.cm.Colormap` instance or - *None*. If *cmap* is *None* and *colors* is *None*, a - default Colormap is used. - - *norm*: [ None | Normalize ] - A :class:`matplotlib.colors.Normalize` instance for - scaling data values to colors. If *norm* is *None* and - *colors* is *None*, the default linear scaling is used. - - *origin*: [ None | 'upper' | 'lower' | 'image' ] - If *None*, the first value of *Z* will correspond to the - lower left corner, location (0,0). If 'image', the rc - value for ``image.origin`` will be used. - - This keyword is not active if *X* and *Y* are specified in - the call to contour. - - *extent*: [ None | (x0,x1,y0,y1) ] - - If *origin* is not *None*, then *extent* is interpreted as - in :func:`matplotlib.pyplot.imshow`: it gives the outer - pixel boundaries. In this case, the position of Z[0,0] - is the center of the pixel, not a corner. If *origin* is - *None*, then (*x0*, *y0*) is the position of Z[0,0], and - (*x1*, *y1*) is the position of Z[-1,-1]. - - This keyword is not active if *X* and *Y* are specified in - the call to contour. - - *locator*: [ None | ticker.Locator subclass ] - If *locator* is None, the default - :class:`~matplotlib.ticker.MaxNLocator` is used. The - locator is used to determine the contour levels if they - are not given explicitly via the *V* argument. - - *extend*: [ 'neither' | 'both' | 'min' | 'max' ] - Unless this is 'neither', contour levels are automatically - added to one or both ends of the range so that all data - are included. These added ranges are then mapped to the - special colormap values which default to the ends of the - colormap range, but can be set via - :meth:`matplotlib.cm.Colormap.set_under` and - :meth:`matplotlib.cm.Colormap.set_over` methods. - -contour-only keyword arguments: - - *linewidths*: [ None | number | tuple of numbers ] - If *linewidths* is *None*, the default width in - ``lines.linewidth`` in ``matplotlibrc`` is used. - - If a number, all levels will be plotted with this linewidth. - - If a tuple, different levels will be plotted with different - linewidths in the order specified - - *linestyles*: [None | 'solid' | 'dashed' | 'dashdot' | 'dotted' ] - If *linestyles* is *None*, the 'solid' is used. - - *linestyles* can also be an iterable of the above strings - specifying a set of linestyles to be used. If this - iterable is shorter than the number of contour levels - it will be repeated as necessary. - - If contour is using a monochrome colormap and the contour - level is less than 0, then the linestyle specified - in ``contour.negative_linestyle`` in ``matplotlibrc`` - will be used. - -contourf-only keyword arguments: - - *antialiased*: [ True | False ] - enable antialiasing - - *nchunk*: [ 0 | integer ] - If 0, no subdivision of the domain. Specify a positive integer to - divide the domain into subdomains of roughly *nchunk* by *nchunk* - points. This may never actually be advantageous, so this option may - be removed. Chunking introduces artifacts at the chunk boundaries - unless *antialiased* is *False*. - -**Example:** - -.. plot:: mpl_examples/pylab_examples/contour_demo.py - -Additional kwargs: hold = [True|False] overrides default hold state -""" ax = gca() # allow callers to override the hold state by passing hold=True|False washold = ax.ishold() @@ -3060,148 +1879,12 @@ ax.hold(washold) if ret._A is not None: gci._current = ret return ret +if Axes.contourf.__doc__ is not None: + contourf.__doc__ = dedent(Axes.contourf.__doc__) + __docstring_addendum # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def csd(x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none, window=mlab.window_hanning, noverlap=0, pad_to=None, sides='default', scale_by_freq=None, hold=None, **kwargs): - """call signature:: - - csd(x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none, - window=mlab.window_hanning, noverlap=0, pad_to=None, - sides='default', scale_by_freq=None, **kwargs) - -The cross spectral density :math:`P_{xy}` by Welch's average -periodogram method. The vectors *x* and *y* are divided into -*NFFT* length segments. Each segment is detrended by function -*detrend* and windowed by function *window*. The product of -the direct FFTs of *x* and *y* are averaged over each segment -to compute :math:`P_{xy}`, with a scaling to correct for power -loss due to windowing. - -Returns the tuple (*Pxy*, *freqs*). *P* is the cross spectrum -(complex valued), and :math:`10\\log_{10}|P_{xy}|` is -plotted. - -Keyword arguments: - - *NFFT*: integer - The number of data points used in each block for the FFT. - Must be even; a power 2 is most efficient. The default value is 256. - - *Fs*: scalar - The sampling frequency (samples per time unit). It is used - to calculate the Fourier frequencies, freqs, in cycles per time - unit. The default value is 2. - - *detrend*: callable - The function applied to each segment before fft-ing, - designed to remove the mean or linear trend. Unlike in - matlab, where the *detrend* parameter is a vector, in - matplotlib is it a function. The :mod:`~matplotlib.pylab` - module defines :func:`~matplotlib.pylab.detrend_none`, - :func:`~matplotlib.pylab.detrend_mean`, and - :func:`~matplotlib.pylab.detrend_linear`, but you can use - a custom function as well. - - *window*: callable or ndarray - A function or a vector of length *NFFT*. To create window - vectors see :func:`window_hanning`, :func:`window_none`, - :func:`numpy.blackman`, :func:`numpy.hamming`, - :func:`numpy.bartlett`, :func:`scipy.signal`, - :func:`scipy.signal.get_window`, etc. The default is - :func:`window_hanning`. If a function is passed as the - argument, it must take a data segment as an argument and - return the windowed version of the segment. - - *noverlap*: integer - The number of points of overlap between blocks. The default value - is 0 (no overlap). - - *pad_to*: integer - The number of points to which the data segment is padded when - performing the FFT. This can be different from *NFFT*, which - specifies the number of data points used. While not increasing - the actual resolution of the psd (the minimum distance between - resolvable peaks), this can give more points in the plot, - allowing for more detail. This corresponds to the *n* parameter - in the call to fft(). The default is None, which sets *pad_to* - equal to *NFFT* - - *sides*: [ 'default' | 'onesided' | 'twosided' ] - Specifies which sides of the PSD to return. Default gives the - default behavior, which returns one-sided for real data and both - for complex data. 'onesided' forces the return of a one-sided PSD, - while 'twosided' forces two-sided. - - *scale_by_freq*: boolean - Specifies whether the resulting density values should be scaled - by the scaling frequency, which gives density in units of Hz^-1. - This allows for integration over the returned frequency values. - The default is True for MatLab compatibility. - - *Fc*: integer - The center frequency of *x* (defaults to 0), which offsets - the x extents of the plot to reflect the frequency range used - when a signal is acquired and then filtered and downsampled to - baseband. - -References: - Bendat & Piersol -- Random Data: Analysis and Measurement - Procedures, John Wiley & Sons (1986) - -kwargs control the Line2D properties: - - alpha: float (0.0 transparent through 1.0 opaque) - animated: [True | False] - antialiased or aa: [True | False] - axes: an :class:`~matplotlib.axes.Axes` instance - clip_box: a :class:`matplotlib.transforms.Bbox` instance - clip_on: [True | False] - clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ] - color or c: any matplotlib color - contains: a callable function - dash_capstyle: ['butt' | 'round' | 'projecting'] - dash_joinstyle: ['miter' | 'round' | 'bevel'] - dashes: sequence of on/off ink in points - data: 2D array - drawstyle: [ 'default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post' ] - figure: a :class:`matplotlib.figure.Figure` instance - fillstyle: ['full' | 'left' | 'right' | 'bottom' | 'top'] - gid: an id string - label: any string - linestyle or ls: [ '-' | '--' | '-.' | ':' | 'None' | ' ' | '' ] and any drawstyle in combination with a linestyle, e.g. 'steps--'. - linewidth or lw: float value in points - lod: [True | False] - marker: [ '+' | '*' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|' | TICKUP | TICKDOWN | TICKLEFT | TICKRIGHT | 'None' | ' ' | '' ] - markeredgecolor or mec: any matplotlib color - markeredgewidth or mew: float value in points - markerfacecolor or mfc: any matplotlib color - markersize or ms: float - markevery: None | integer | (startind, stride) - picker: float distance in points or callable pick function ``fn(artist, event)`` - pickradius: float distance in points - rasterized: [True | False | None] - snap: unknown - solid_capstyle: ['butt' | 'round' | 'projecting'] - solid_joinstyle: ['miter' | 'round' | 'be... [truncated message content] |
From: <jd...@us...> - 2009-08-05 02:29:21
|
Revision: 7358 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7358&view=rev Author: jdh2358 Date: 2009-08-05 02:29:12 +0000 (Wed, 05 Aug 2009) Log Message: ----------- some fixes for osx builds on rc2 Modified Paths: -------------- branches/v0_99_maint/doc/_templates/indexsidebar.html branches/v0_99_maint/lib/matplotlib/__init__.py branches/v0_99_maint/release/osx/Makefile branches/v0_99_maint/release/osx/README.txt Modified: branches/v0_99_maint/doc/_templates/indexsidebar.html =================================================================== --- branches/v0_99_maint/doc/_templates/indexsidebar.html 2009-08-05 00:11:42 UTC (rev 7357) +++ branches/v0_99_maint/doc/_templates/indexsidebar.html 2009-08-05 02:29:12 UTC (rev 7358) @@ -3,7 +3,7 @@ <p>Please <a href="http://sourceforge.net/project/project_donations.php?group_id=80706">donate</a> to support matplotlib development.</p> -<p>A release candidate rc1 of matplotlib-0.99.0 is <a href="http://drop.io/xortel1#">available</a> for testing. Please post any bugs to the <a href="http://sourceforge.net/tracker2/?group_id=80706">tracker</a> +<p>A release candidate rc2 of matplotlib-0.99.0 is <a href="http://drop.io/xortel1#">available</a> for testing. Please post any bugs to the <a href="http://sourceforge.net/tracker2/?group_id=80706">tracker</a> </p> <p>Watch a <a href="http://videolectures.net/mloss08_hunter_mat">video lecture</a> about matplotlib presented at <a href="http://videolectures.net/mloss08_whistler">NIPS 08 Workshop</a> <i>Machine Learning Open Source Software</i></a>. Modified: branches/v0_99_maint/lib/matplotlib/__init__.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/__init__.py 2009-08-05 00:11:42 UTC (rev 7357) +++ branches/v0_99_maint/lib/matplotlib/__init__.py 2009-08-05 02:29:12 UTC (rev 7358) @@ -89,7 +89,7 @@ """ from __future__ import generators -__version__ = '0.99.0.rc1' +__version__ = '0.99.0.rc2' __revision__ = '$Revision$' __date__ = '$Date$' Modified: branches/v0_99_maint/release/osx/Makefile =================================================================== --- branches/v0_99_maint/release/osx/Makefile 2009-08-05 00:11:42 UTC (rev 7357) +++ branches/v0_99_maint/release/osx/Makefile 2009-08-05 02:29:12 UTC (rev 7358) @@ -1,10 +1,10 @@ -PYVERSION=2.6 +PYVERSION=2.5 PYTHON=python${PYVERSION} SRCDIR=${PWD} ZLIBVERSION=1.2.3 PNGVERSION=1.2.33 FREETYPEVERSION=2.3.7 -MPLVERSION=0.99.0.rc1 +MPLVERSION=0.99.0.rc2 BDISTMPKGVERSION=0.4.4 MPLSRC=matplotlib-${MPLVERSION} MACOSX_DEPLOYMENT_TARGET=10.4 @@ -88,7 +88,7 @@ cp ../data/setup.cfg . &&\ export CFLAGS=${CFLAGS} &&\ export LDFLAGS=${LDFLAGS} &&\ - bdist_mpkg &&\ + /Library/Frameworks/Python.framework/Versions/${PYVERSION}/bin/bdist_mpkg &&\ ${PYTHON} setupegg.py bdist_egg &&\ cd dist && \ zip -ro matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5_mpkg.zip matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.mpkg Modified: branches/v0_99_maint/release/osx/README.txt =================================================================== --- branches/v0_99_maint/release/osx/README.txt 2009-08-05 00:11:42 UTC (rev 7357) +++ branches/v0_99_maint/release/osx/README.txt 2009-08-05 02:29:12 UTC (rev 7358) @@ -7,7 +7,7 @@ ------------- * :file:`bdist_mkpg` - the distutils.extension to build Installer.app - mpkg installers. + mpkg installers. * :file:`data` - some config files and patches needed for the build @@ -19,16 +19,22 @@ How to build -------------- -* You need a python framework build , numpy and wxpython to build the +* You need a python framework build, numpy and wxpython to build the mpl installers (wx requires this and we need wx to build the wxagg - extension). You can get the three required dependencies as - Installer apps, eg: + extension). I recommend building python from src as a framework build:: + ./configure --enable-universalsdk --enable-framework + sudo make install - http://www.python.org/ftp/python/2.6.2/python-2.6.2-macosx2009-04-16.dmg - http://downloads.sourceforge.net/project/numpy/NumPy/1.3.0/numpy-1.3.0-py2.6-macosx10.5.dmg?use_mirror=voxel - http://downloads.sourceforge.net/project/wxpython/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg?use_mirror=voxel + and build numpy from src too since the 2.5 numpy installer doesn't work + with a python built from src:: + sudo python setup.py install + + you can use the pre-built installer for wx:: + + http://downloads.sourceforge.net/project/wxpython/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg?use_mirror=voxel + * You need to make sure to unset PKG_CONFIG_PATH to make sure the static linking below is respected. Otherwise the mpl build script will dynamically link using the libs from pkgconfig if you have this This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-06 11:53:39
|
Revision: 7396 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7396&view=rev Author: jdh2358 Date: 2009-08-06 11:53:23 +0000 (Thu, 06 Aug 2009) Log Message: ----------- removed pylab load and save Modified Paths: -------------- branches/v0_99_maint/CHANGELOG branches/v0_99_maint/doc/api/api_changes.rst branches/v0_99_maint/lib/matplotlib/pylab.py Modified: branches/v0_99_maint/CHANGELOG =================================================================== --- branches/v0_99_maint/CHANGELOG 2009-08-05 19:49:43 UTC (rev 7395) +++ branches/v0_99_maint/CHANGELOG 2009-08-06 11:53:23 UTC (rev 7396) @@ -1,7 +1,12 @@ + 2009-08-03 Fixed boilerplate.py so it doesn't break the ReST docs. - JKS -====================================================================== +2009-08-03 pylab no longer provides a load and save function. These + are available in matplotlib.mlab, or you can use + numpy.loadtxt and numpy.savetxt for text files, or np.save + and np.load for binary numpy arrays. - JDH + 2009-07-31 Tagging 0.99.0.rc1 at 7314 - MGD 2009-07-30 Add set_cmap and register_cmap, and improve get_cmap, Modified: branches/v0_99_maint/doc/api/api_changes.rst =================================================================== --- branches/v0_99_maint/doc/api/api_changes.rst 2009-08-05 19:49:43 UTC (rev 7395) +++ branches/v0_99_maint/doc/api/api_changes.rst 2009-08-06 11:53:23 UTC (rev 7396) @@ -18,9 +18,14 @@ .. _configobj: http://www.voidspace.org.uk/python/configobj.html .. _`enthought.traits`: http://code.enthought.com/projects/traits -Changes beyond 0.98.x -===================== +Changes in 0.99 +====================== +* pylab no longer provides a load and save function. These are + available in matplotlib.mlab, or you can use numpy.loadtxt and + numpy.savetxt for text files, or np.save and np.load for binary + numpy arrays. + * User-generated colormaps can now be added to the set recognized by :func:`matplotlib.cm.get_cmap`. Colormaps can be made the default and applied to the current image using Modified: branches/v0_99_maint/lib/matplotlib/pylab.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/pylab.py 2009-08-05 19:49:43 UTC (rev 7395) +++ branches/v0_99_maint/lib/matplotlib/pylab.py 2009-08-06 11:53:23 UTC (rev 7396) @@ -236,6 +236,9 @@ base_repr, binary_repr, log2, ispower2, \ rec_append_fields, rec_drop_fields, rec_join, csv2rec, rec2csv, isvector +import matplotlib.mlab as mlab +import matplotlib.cbook as cbook + from numpy import * from numpy.fft import * from numpy.random import * @@ -248,3 +251,25 @@ import numpy as np import numpy.ma as ma +def load(*args, **kwargs): + raise NotImplementedError(load.__doc__) +load.__doc__ = """\ + pylab no longer provides a load function, though the old pylab + function is still available as matplotlib.mlab.load (you can refer + to it in pylab as "mlab.load"). However, for plain text files, we + recommend numpy.loadtxt, which was inspired by the old pylab.load + but now has more features. For loading numpy arrays, we recommend + numpy.load, and its analog numpy.save, which are available in + pylab as np.load and np.save. + """ + + +def save(*args, **kwargs): + raise NotImplementedError(save.__doc__) +save.__doc__ = """\ + pylab no longer provides a save function, though the old pylab + function is still available as matplotlib.mlab.save (you can still + refer to it in pylab as "mlab.save"). However, for plain text + files, we recommend numpy.savetxt. For saving numpy arrays, + we recommend numpy.save, and its analog numpy.load, which are + available in pylab as np.save and np.load.""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-06 12:02:43
|
Revision: 7397 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7397&view=rev Author: jdh2358 Date: 2009-08-06 12:02:33 +0000 (Thu, 06 Aug 2009) Log Message: ----------- tagging for 0.99 release Modified Paths: -------------- branches/v0_99_maint/CHANGELOG branches/v0_99_maint/lib/matplotlib/__init__.py branches/v0_99_maint/release/osx/Makefile branches/v0_99_maint/release/osx/README.txt Added Paths: ----------- branches/v0_99_maint/release/osx/data/ReadMe.txt Modified: branches/v0_99_maint/CHANGELOG =================================================================== --- branches/v0_99_maint/CHANGELOG 2009-08-06 11:53:23 UTC (rev 7396) +++ branches/v0_99_maint/CHANGELOG 2009-08-06 12:02:33 UTC (rev 7397) @@ -1,4 +1,32 @@ +2009-08-06 Tagging the 0.99.0 release at svn r7395 - JDH + * fixed an alpha colormapping bug posted on sf 2832575 + + * fix typo in axes_divider.py. use nanmin, nanmax in angle_helper.py (patch by Christoph Gohlke) + + * remove dup gui event in enter/leave events in gtk + + * lots of fixes for os x binaries (Thanks Russell Owen) + + * attach gtk events to mpl events -- fixes sf bug 2816580 + + * applied sf patch 2815064 (middle button events for wx) and patch 2818092 (resize events for wx) + + * fixed boilerplate.py so it doesn't break the ReST docs. + + * removed a couple of cases of mlab.load + + * fixed rec2csv win32 file handle bug from sf patch 2831018 + + * added two examples from Josh Hemann: examples/pylab_examples/barchart_demo2.py and + examples/pylab_examples/boxplot_demo2.py + + * handled sf bugs 2831556 and 2830525; better bar error messages and backend driver configs + + * added miktex win32 patch from sf patch 2820194 + + * apply sf patches 2830233 and 2823885 for osx setup and 64 bit; thanks Michiel + 2009-08-03 Fixed boilerplate.py so it doesn't break the ReST docs. - JKS Modified: branches/v0_99_maint/lib/matplotlib/__init__.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/__init__.py 2009-08-06 11:53:23 UTC (rev 7396) +++ branches/v0_99_maint/lib/matplotlib/__init__.py 2009-08-06 12:02:33 UTC (rev 7397) @@ -89,7 +89,7 @@ """ from __future__ import generators -__version__ = '0.99.0.rc2' +__version__ = '0.99.0' __revision__ = '$Revision$' __date__ = '$Date$' Modified: branches/v0_99_maint/release/osx/Makefile =================================================================== --- branches/v0_99_maint/release/osx/Makefile 2009-08-06 11:53:23 UTC (rev 7396) +++ branches/v0_99_maint/release/osx/Makefile 2009-08-06 12:02:33 UTC (rev 7397) @@ -1,10 +1,10 @@ -PYVERSION=2.5 +PYVERSION=2.6 PYTHON=python${PYVERSION} SRCDIR=${PWD} ZLIBVERSION=1.2.3 PNGVERSION=1.2.33 FREETYPEVERSION=2.3.7 -MPLVERSION=0.99.0.rc2 +MPLVERSION=0.99.0 BDISTMPKGVERSION=0.4.4 MPLSRC=matplotlib-${MPLVERSION} MACOSX_DEPLOYMENT_TARGET=10.4 @@ -28,7 +28,7 @@ zlib-${ZLIBVERSION} libpng-${PNGVERSION} freetype-${FREETYPEVERSION} \ matplotlib-${MPLVERSION} *~ -fetch_deps: +fetch: wget http://www.zlib.net/zlib-${ZLIBVERSION}.tar.gz &&\ wget http://internap.dl.sourceforge.net/sourceforge/libpng/libpng-${PNGVERSION}.tar.bz2 &&\ wget http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPEVERSION}.tar.bz2&&\ @@ -77,7 +77,7 @@ cp objs/.libs/libfreetype.a . &&\ unset MACOSX_DEPLOYMENT_TARGET -dependencies: +deps: make zlib png freetype installers: @@ -85,13 +85,12 @@ tar xvfz matplotlib-${MPLVERSION}.tar.gz && \ cd ${MPLSRC} && \ rm -rf build && \ - cp ../data/setup.cfg . &&\ + cp ../data/setup.cfg ../data/ReadMe.txt . &&\ export CFLAGS=${CFLAGS} &&\ export LDFLAGS=${LDFLAGS} &&\ - /Library/Frameworks/Python.framework/Versions/${PYVERSION}/bin/bdist_mpkg &&\ - ${PYTHON} setupegg.py bdist_egg &&\ - cd dist && \ - zip -ro matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5_mpkg.zip matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.mpkg + /Library/Frameworks/Python.framework/Versions/${PYVERSION}/bin/bdist_mpkg --readme=ReadMe.txt &&\ + hdiutil create -srcdir dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.mpkg dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.dmg &&\ + ${PYTHON} setupegg.py bdist_egg upload: rm -rf upload &&\ @@ -102,7 +101,7 @@ scp upload/* jd...@fr...:uploads/ all: - make clean fetch_deps dependencies installers upload + make clean fetch deps installers upload Modified: branches/v0_99_maint/release/osx/README.txt =================================================================== --- branches/v0_99_maint/release/osx/README.txt 2009-08-06 11:53:23 UTC (rev 7396) +++ branches/v0_99_maint/release/osx/README.txt 2009-08-06 12:02:33 UTC (rev 7397) @@ -48,16 +48,16 @@ * First fetch all the dependencies and patch bdist_mpkg for OSX 10.5. You can do this automatically in one step with:: - make fetch_deps + make fetch -* install the patched bdist_mpkg, that the fetch_deps step just created:: +* install the patched bdist_mpkg, that the fetch step just created:: cd bdist_mpkg-0.4.4 sudo python setup.py install * build the dependencies:: - make dependencies + make deps * copy over the latest mpl *.tar.gz tarball to this directory, update the MPLVERSION in the Makefile:: @@ -77,11 +77,11 @@ cd release/osx/ unset PKG_CONFIG_PATH - make fetch_deps + make fetch cd bdist_mpkg-0.4.4 sudo python setup.py install cd .. - make dependencies + make deps Build the mpl sdist:: Added: branches/v0_99_maint/release/osx/data/ReadMe.txt =================================================================== --- branches/v0_99_maint/release/osx/data/ReadMe.txt (rev 0) +++ branches/v0_99_maint/release/osx/data/ReadMe.txt 2009-08-06 12:02:33 UTC (rev 7397) @@ -0,0 +1 @@ +Find file: ~/Desktop/ \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-06 12:17:54
|
Revision: 7398 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7398&view=rev Author: jdh2358 Date: 2009-08-06 12:17:45 +0000 (Thu, 06 Aug 2009) Log Message: ----------- final build of 0.99.0 Modified Paths: -------------- branches/v0_99_maint/CHANGELOG branches/v0_99_maint/release/osx/data/ReadMe.txt Modified: branches/v0_99_maint/CHANGELOG =================================================================== --- branches/v0_99_maint/CHANGELOG 2009-08-06 12:02:33 UTC (rev 7397) +++ branches/v0_99_maint/CHANGELOG 2009-08-06 12:17:45 UTC (rev 7398) @@ -1,8 +1,9 @@ -2009-08-06 Tagging the 0.99.0 release at svn r7395 - JDH +2009-08-06 Tagging the 0.99.0 release at svn r7397 - JDH * fixed an alpha colormapping bug posted on sf 2832575 - * fix typo in axes_divider.py. use nanmin, nanmax in angle_helper.py (patch by Christoph Gohlke) + * fix typo in axes_divider.py. use nanmin, nanmax in angle_helper.py + (patch by Christoph Gohlke) * remove dup gui event in enter/leave events in gtk @@ -10,7 +11,8 @@ * attach gtk events to mpl events -- fixes sf bug 2816580 - * applied sf patch 2815064 (middle button events for wx) and patch 2818092 (resize events for wx) + * applied sf patch 2815064 (middle button events for wx) and + patch 2818092 (resize events for wx) * fixed boilerplate.py so it doesn't break the ReST docs. @@ -18,10 +20,11 @@ * fixed rec2csv win32 file handle bug from sf patch 2831018 - * added two examples from Josh Hemann: examples/pylab_examples/barchart_demo2.py and - examples/pylab_examples/boxplot_demo2.py + * added two examples from Josh Hemann: examples/pylab_examples/barchart_demo2.py + and examples/pylab_examples/boxplot_demo2.py - * handled sf bugs 2831556 and 2830525; better bar error messages and backend driver configs + * handled sf bugs 2831556 and 2830525; better bar error messages and + backend driver configs * added miktex win32 patch from sf patch 2820194 @@ -29,7 +32,6 @@ 2009-08-03 Fixed boilerplate.py so it doesn't break the ReST docs. - JKS - 2009-08-03 pylab no longer provides a load and save function. These are available in matplotlib.mlab, or you can use numpy.loadtxt and numpy.savetxt for text files, or np.save Modified: branches/v0_99_maint/release/osx/data/ReadMe.txt =================================================================== --- branches/v0_99_maint/release/osx/data/ReadMe.txt 2009-08-06 12:02:33 UTC (rev 7397) +++ branches/v0_99_maint/release/osx/data/ReadMe.txt 2009-08-06 12:17:45 UTC (rev 7398) @@ -1 +1,45 @@ -Find file: ~/Desktop/ \ No newline at end of file +matplotlib for MacOS X 10.3.9 or later and Python 2.5 and Python 2.6 + +matplotlib is a python 2D plotting library which produces publication +quality figures in a variety of hardcopy formats and interactive +environments across platforms. matplotlib can be used in python +scripts, the python and ipython shell (ala matlab or mathematica), web +application servers, and various graphical user interface toolkits. + +Home page: <http://matplotlib.sourceforge.net/> + +Before running matplotlib, you must install numpy. Binary installers +for all these packages are available here: + + <http://pythonmac.org/packages/py25-fat/index.html>. + +*** Back Ends *** + +You may use TkAgg or WXAgg back ends; Qt and GTK support is not +provided in this package. By default this matplotlib uses TkAgg +because Tcl/Tk is included with MacOS X. + +If you wish to use WXAgg then: +* Install wxPython from: + <http://pythonmac.org/packages/py25-fat/index.html>. +* Configure a matplotlibrc file, as described below. + +For TkAgg you may use Apple's built-in Tcl/Tk or install your own 8.4.x + +*** Configuring a matplotlibrc file *** + +If you wish to change any matplotlib settings, create a file: + ~/.matplotlib/matplotlibrc + + +that contains at least the following information. The values shown are +the defaults in the internal matplotlibrc file; change them as you see +fit: + +# the default backend; one of GTK GTKAgg GTKCairo FltkAgg QtAgg TkAgg WXAgg +# Agg Cairo GD GDK Paint PS PDF SVG Template +backend : TkAgg +interactive : False # see http://matplotlib.sourceforge.net/interactive.html + +See also +<http://matplotlib.sourceforge.net/users/customizing.html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-06 18:52:10
|
Revision: 7407 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7407&view=rev Author: jdh2358 Date: 2009-08-06 18:51:58 +0000 (Thu, 06 Aug 2009) Log Message: ----------- hide colorbar_doc a bit Modified Paths: -------------- branches/v0_99_maint/doc/_templates/indexsidebar.html branches/v0_99_maint/doc/users/credits.rst branches/v0_99_maint/doc/users/screenshots.rst branches/v0_99_maint/doc/users/whats_new.rst branches/v0_99_maint/lib/matplotlib/pyplot.py Modified: branches/v0_99_maint/doc/_templates/indexsidebar.html =================================================================== --- branches/v0_99_maint/doc/_templates/indexsidebar.html 2009-08-06 18:49:24 UTC (rev 7406) +++ branches/v0_99_maint/doc/_templates/indexsidebar.html 2009-08-06 18:51:58 UTC (rev 7407) @@ -28,7 +28,7 @@ and join the matplotlib mailing <a href="http://sourceforge.net/mail/?group_id=80706">lists</a>. The <a href="{{ pathto('search') }}">search</a> tool searches all of -the documentation, including full text search of almost 300 complete +the documentation, including full text search of over 350 complete examples which exercise almost every corner of matplotlib.</p> <p>You can file bugs, patches and feature requests on the Modified: branches/v0_99_maint/doc/users/credits.rst =================================================================== --- branches/v0_99_maint/doc/users/credits.rst 2009-08-06 18:49:24 UTC (rev 7406) +++ branches/v0_99_maint/doc/users/credits.rst 2009-08-06 18:51:58 UTC (rev 7407) @@ -16,9 +16,9 @@ Jeremy O'Donoghue wrote the wx backend -Andrew Straw - provided much of the log scaling architecture, the fill command, PIL - support for imshow, and provided many examples +Andrew Straw provided much of the log scaling architecture, the fill + command, PIL support for imshow, and provided many examples. He + also wrote the support for dropped axis spines. Charles Twardy provided the impetus code for the legend class and has made @@ -28,7 +28,6 @@ made many enhancements to errorbar to support x and y errorbar plots, and added a number of new marker types to plot. - John Gill wrote the table class and examples, helped with support for auto-legend placement, and added support for legending scatter @@ -133,7 +132,7 @@ most aspects of matplotlib. Daishi Harada - added support for "Dashed Text". See ` dashpointlabel.py + added support for "Dashed Text". See `dashpointlabel.py <examples/pylab_examples/dashpointlabel.py>`_ and :class:`~matplotlib.text.TextWithDash`. @@ -147,11 +146,10 @@ Charlie Moad - contributed work to matplotlib's Cocoa support and does the binary - builds and releases. + contributed work to matplotlib's Cocoa support and has done a lot of work on the OSX and win32 binary releases. -Jouni K. Seppaenen - wrote the PDF backend. +Jouni K. Seppaenen wrote the PDF backend and contributed numerous + fixes to the code, to tex support and to the get_sample_data handler Paul Kienzle improved the picking infrastruture for interactive plots, and with @@ -171,4 +169,7 @@ matplotlib, and Jonathon Taylor and Reinier Heeres ported it to the refactored transform trunk. - +Jae-Joon Lee implemented fancy arrows and boxes, rewrote the legend + support to handle multiple columns and fancy text boxes, wrote the + axes grid toolkit, and has made numerous contributions to the code + and documentation \ No newline at end of file Modified: branches/v0_99_maint/doc/users/screenshots.rst =================================================================== --- branches/v0_99_maint/doc/users/screenshots.rst 2009-08-06 18:49:24 UTC (rev 7406) +++ branches/v0_99_maint/doc/users/screenshots.rst 2009-08-06 18:51:58 UTC (rev 7407) @@ -45,8 +45,23 @@ .. plot:: mpl_examples/api/path_patch_demo.py +.. _screenshots_mplot3d_surface: + +mplot3d +========= + +The mplot3d toolkit (see :ref:`toolkit_mplot3d-tutorial` and +:ref:`mplot3d-examples-index`) has support for simple 3d graphs +including surface, wireframe, scatter, and bar charts (added in +matlpotlib-0.99). Thanks to John Porter, Jonathon Taylor and Reinier +Heeres for the mplot3d toolkit. The toolkit is included with all +standard matplotlib installs. + +.. plot:: mpl_examples/mplot3d/surface3d_demo.py + .. _screenshots_ellipse_demo: + Ellipses ======== Modified: branches/v0_99_maint/doc/users/whats_new.rst =================================================================== --- branches/v0_99_maint/doc/users/whats_new.rst 2009-08-06 18:49:24 UTC (rev 7406) +++ branches/v0_99_maint/doc/users/whats_new.rst 2009-08-06 18:51:58 UTC (rev 7407) @@ -18,8 +18,8 @@ Reinier Heeres has ported John Porter's mplot3d over to the new matplotlib transformations framework, and it is now available as a -toolkit mpl_toolkits.mplot3d. See the `examples -<http://matplotlib.sourceforge.net/examples/mplot3d/index.html>`_ and +toolkit mpl_toolkits.mplot3d (which now comes standard with all mpl +installs). See :ref:`mplot3d-examples-index` and :ref:`toolkit_mplot3d-tutorial` .. plot:: pyplots/whats_new_99_mplot3d.py @@ -29,10 +29,11 @@ axes grid toolkit ----------------- -Jae Joon has added a new toolkit to ease displaying multiple images in +Jae-Joon Lee has added a new toolkit to ease displaying multiple images in matplotlib, as well as some support for curvilinear grids to support -the world coordinate system. See :ref:`axes_grid_users-guide-index` -and `examples <http://matplotlib.sourceforge.net/examples/axes_grid/index.html>`_ +the world coordinate system. The toolkit is included standard with all +new mpl installs. See :ref:`axes_grid-examples-index` and +:ref:`axes_grid_users-guide-index`. .. plot:: pyplots/whats_new_99_axes_grid.py Modified: branches/v0_99_maint/lib/matplotlib/pyplot.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/pyplot.py 2009-08-06 18:49:24 UTC (rev 7406) +++ branches/v0_99_maint/lib/matplotlib/pyplot.py 2009-08-06 18:51:58 UTC (rev 7407) @@ -1359,7 +1359,7 @@ ## Plotting part 1: manually generated functions and wrappers ## -from matplotlib.colorbar import colorbar_doc +from matplotlib.colorbar import colorbar_doc as _colorbar_doc def colorbar(mappable=None, cax=None, ax=None, **kw): if mappable is None: mappable = gci() @@ -1369,7 +1369,7 @@ ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw) draw_if_interactive() return ret -colorbar.__doc__ = colorbar_doc +colorbar.__doc__ = _colorbar_doc def clim(vmin=None, vmax=None): """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-07 15:41:04
|
Revision: 7416 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7416&view=rev Author: jdh2358 Date: 2009-08-07 15:40:56 +0000 (Fri, 07 Aug 2009) Log Message: ----------- don't fail on window icon load Modified Paths: -------------- branches/v0_99_maint/doc/devel/coding_guide.rst branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py Modified: branches/v0_99_maint/doc/devel/coding_guide.rst =================================================================== --- branches/v0_99_maint/doc/devel/coding_guide.rst 2009-08-07 14:26:35 UTC (rev 7415) +++ branches/v0_99_maint/doc/devel/coding_guide.rst 2009-08-07 15:40:56 UTC (rev 7416) @@ -24,17 +24,11 @@ svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/\ matplotlib mpl --username=youruser --password=yourpass -Branch checkouts, eg the maintenance branch:: +Branch checkouts, eg the release branch:: - svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/\ - v0_91_maint mpl91 --username=youruser --password=yourpass + svn co https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_99_maint mpl99 -The current release of the trunk is in the 0.98.5 maintenance branch:: - svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/\ - v0_98_5_maint mpl98.5 --username=youruser --password=yourpass - - Committing changes ------------------ @@ -64,11 +58,10 @@ :file:`MANIFEST.in`. This file determines what goes into the source distribution of the mpl build. -* Keep the maintenance branch (0.91) the latest release branch (eg - 0.98.4) and trunk in sync where it makes sense. If there is a bug - on both that needs fixing, use `svnmerge.py - <http://www.orcaware.com/svn/wiki/Svnmerge.py>`_ to keep them in - sync. See :ref:`svn-merge` below. +* Keep the release branch (eg 0.90 and trunk in sync where it makes + sense. If there is a bug on both that needs fixing, use + `svnmerge.py <http://www.orcaware.com/svn/wiki/Svnmerge.py>`_ to + keep them in sync. See :ref:`svn-merge` below. .. _svn-merge: @@ -96,7 +89,7 @@ svnmerge.py merge -S BRANCHNAME Where BRANCHNAME is the name of the branch to merge *from*, - e.g. v0_98_5_maint. + e.g. v0_99_maint. If you wish to merge only specific revisions (in an unusual situation), do:: Modified: branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py 2009-08-07 14:26:35 UTC (rev 7415) +++ branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py 2009-08-07 15:40:56 UTC (rev 7416) @@ -440,8 +440,15 @@ self.window = gtk.Window() self.window.set_title("Figure %d" % num) if (window_icon): - self.window.set_icon_from_file(window_icon) - + try: + self.window.set_icon_from_file(window_icon) + except: + # some versions of gtk throw a glib.GError but not + # all, so I am not sure how to catch it. I am unhappy + # diong a blanket catch here, but an not sure what a + # better way is - JDH + verbose.report('Could not load matplotlib icon: %s' % sys.exc_info()[1]) + self.vbox = gtk.VBox() self.window.add(self.vbox) self.vbox.show() @@ -666,7 +673,11 @@ window = gtk.Window() if (window_icon): - window.set_icon_from_file(window_icon) + try: window.set_icon_from_file(window_icon) + except: + # we presumably already logged a message on the + # failure of the main plot, don't keep reporting + pass window.set_title("Subplot Configuration Tool") window.set_default_size(w, h) vbox = gtk.VBox() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-08 15:10:17
|
Revision: 7431 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7431&view=rev Author: jdh2358 Date: 2009-08-08 15:10:08 +0000 (Sat, 08 Aug 2009) Log Message: ----------- use a class helper method to make the compound path from polys Modified Paths: -------------- branches/v0_99_maint/examples/animation/histogram_tkagg.py branches/v0_99_maint/examples/api/histogram_path_demo.py branches/v0_99_maint/lib/matplotlib/path.py Modified: branches/v0_99_maint/examples/animation/histogram_tkagg.py =================================================================== --- branches/v0_99_maint/examples/animation/histogram_tkagg.py 2009-08-08 13:58:52 UTC (rev 7430) +++ branches/v0_99_maint/examples/animation/histogram_tkagg.py 2009-08-08 15:10:08 UTC (rev 7431) @@ -2,6 +2,7 @@ This example shows how to use a path patch to draw a bunch of rectangles for an animated histogram """ +import time import numpy as np import matplotlib matplotlib.use('TkAgg') # do this before importing pylab @@ -52,6 +53,10 @@ ax.set_ylim(bottom.min(), top.max()) def animate(): + if animate.cnt>=100: + return + + animate.cnt += 1 # simulate new data coming in data = np.random.randn(1000) n, bins = np.histogram(data, 100) @@ -59,11 +64,7 @@ verts[1::5,1] = top verts[2::5,1] = top fig.canvas.draw() - -def run(): - for i in range(100): - fig.canvas.manager.window.after(100, animate) - - -fig.canvas.manager.window.after(100, run) + fig.canvas.manager.window.after(100, animate) +animate.cnt = 0 +fig.canvas.manager.window.after(100, animate) plt.show() Modified: branches/v0_99_maint/examples/api/histogram_path_demo.py =================================================================== --- branches/v0_99_maint/examples/api/histogram_path_demo.py 2009-08-08 13:58:52 UTC (rev 7430) +++ branches/v0_99_maint/examples/api/histogram_path_demo.py 2009-08-08 15:10:08 UTC (rev 7431) @@ -20,8 +20,9 @@ # histogram our data with numpy data = np.random.randn(1000) -n, bins = np.histogram(data, 100) +n, bins = np.histogram(data, 50) + # get the corners of the rectangles for the histogram left = np.array(bins[:-1]) right = np.array(bins[1:]) @@ -29,28 +30,24 @@ top = bottom + n nrects = len(left) -# here comes the tricky part -- we have to set up the vertex and path -# codes arrays using moveto, lineto and closepoly +XY = np.zeros((nrects, 4, 2)) +XY[:,0,0] = left +XY[:,0,1] = bottom -# for each rect: 1 for the MOVETO, 3 for the LINETO, 1 for the -# CLOSEPOLY; the vert for the closepoly is ignored but we still need -# it to keep the codes aligned with the vertices -nverts = nrects*(1+3+1) -verts = np.zeros((nverts, 2)) -codes = np.ones(nverts, int) * path.Path.LINETO -codes[0::5] = path.Path.MOVETO -codes[4::5] = path.Path.CLOSEPOLY -verts[0::5,0] = left -verts[0::5,1] = bottom -verts[1::5,0] = left -verts[1::5,1] = top -verts[2::5,0] = right -verts[2::5,1] = top -verts[3::5,0] = right -verts[3::5,1] = bottom +XY[:,1,0] = left +XY[:,1,1] = top -barpath = path.Path(verts, codes) -patch = patches.PathPatch(barpath, facecolor='green', edgecolor='yellow', alpha=0.5) +XY[:,2,0] = right +XY[:,2,1] = top + +XY[:,3,0] = right +XY[:,3,1] = bottom + + + +barpath = path.Path.make_compound_path_from_polys(XY) +print barpath.codes[:7], barpath.codes[-7:] +patch = patches.PathPatch(barpath, facecolor='blue', edgecolor='gray', alpha=0.8) ax.add_patch(patch) ax.set_xlim(left[0], right[-1]) Modified: branches/v0_99_maint/lib/matplotlib/path.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/path.py 2009-08-08 13:58:52 UTC (rev 7430) +++ branches/v0_99_maint/lib/matplotlib/path.py 2009-08-08 15:10:08 UTC (rev 7431) @@ -129,6 +129,34 @@ self._interpolation_steps = _interpolation_steps @classmethod + def make_compound_path_from_polys(cls, XY): + """ + (static method) Make a compound path object to draw a number + of polygons with equal numbers of sides XY is a (numpolys x + numsides x 2) numpy array of vertices. Return object is a + :class:`Path` + + .. plot:: mpl_examples/api/histogram_path_demo.py + + """ + + # for each poly: 1 for the MOVETO, (numsides-1) for the LINETO, 1 for the + # CLOSEPOLY; the vert for the closepoly is ignored but we still need + # it to keep the codes aligned with the vertices + numpolys, numsides, two = XY.shape + assert(two==2) + stride = numsides + 1 + nverts = numpolys * stride + verts = np.zeros((nverts, 2)) + codes = np.ones(nverts, int) * cls.LINETO + codes[0::stride] = cls.MOVETO + codes[numsides::stride] = cls.CLOSEPOLY + for i in range(numsides): + verts[i::stride] = XY[:,i] + + return cls(verts, codes) + + @classmethod def make_compound_path(cls, *args): """ (staticmethod) Make a compound path from a list of Path This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-15 17:56:54
|
Revision: 7490 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7490&view=rev Author: jdh2358 Date: 2009-08-15 17:56:44 +0000 (Sat, 15 Aug 2009) Log Message: ----------- added transformations tut, did some reorg Modified Paths: -------------- branches/v0_99_maint/CXX/IndirectPythonInterface.hxx branches/v0_99_maint/agg24/include/agg_basics.h branches/v0_99_maint/doc/users/index.rst branches/v0_99_maint/doc/users/transforms_tutorial.rst Added Paths: ----------- branches/v0_99_maint/doc/pyplots/annotate_transform.py branches/v0_99_maint/doc/users/annotations_intro.rst branches/v0_99_maint/doc/users/legend_guide.rst Removed Paths: ------------- branches/v0_99_maint/doc/users/annotations_overview.rst branches/v0_99_maint/doc/users/legend.rst Modified: branches/v0_99_maint/CXX/IndirectPythonInterface.hxx =================================================================== --- branches/v0_99_maint/CXX/IndirectPythonInterface.hxx 2009-08-15 17:40:27 UTC (rev 7489) +++ branches/v0_99_maint/CXX/IndirectPythonInterface.hxx 2009-08-15 17:56:44 UTC (rev 7490) @@ -193,6 +193,6 @@ void _XDECREF( PyObject *op ); char *__Py_PackageContext(); -}; +} #endif // __CXX_INDIRECT_PYTHON_INTERFACE__HXX__ Modified: branches/v0_99_maint/agg24/include/agg_basics.h =================================================================== --- branches/v0_99_maint/agg24/include/agg_basics.h 2009-08-15 17:40:27 UTC (rev 7489) +++ branches/v0_99_maint/agg24/include/agg_basics.h 2009-08-15 17:56:44 UTC (rev 7490) @@ -2,8 +2,8 @@ // Anti-Grain Geometry - Version 2.4 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // @@ -25,12 +25,12 @@ #else namespace agg { - // The policy of all AGG containers and memory allocation strategy + // The policy of all AGG containers and memory allocation strategy // in general is that no allocated data requires explicit construction. // It means that the allocator can be really simple; you can even - // replace new/delete to malloc/free. The constructors and destructors - // won't be called in this case, however everything will remain working. - // The second argument of deallocate() is the size of the allocated + // replace new/delete to malloc/free. The constructors and destructors + // won't be called in this case, however everything will remain working. + // The second argument of deallocate() is the size of the allocated // block. You can use this information if you wish. //------------------------------------------------------------pod_allocator template<class T> struct pod_allocator @@ -40,8 +40,8 @@ }; // Single object allocator. It's also can be replaced with your custom - // allocator. The difference is that it can only allocate a single - // object and the constructor and destructor must be called. + // allocator. The difference is that it can only allocate a single + // object and the constructor and destructor must be called. // In AGG there is no need to allocate an array of objects with // calling their constructors (only single ones). So that, if you // replace these new/delete to malloc/free make sure that the in-place @@ -213,23 +213,23 @@ enum cover_scale_e { cover_shift = 8, //----cover_shift - cover_size = 1 << cover_shift, //----cover_size - cover_mask = cover_size - 1, //----cover_mask - cover_none = 0, //----cover_none - cover_full = cover_mask //----cover_full + cover_size = 1 << cover_shift, //----cover_size + cover_mask = cover_size - 1, //----cover_mask + cover_none = 0, //----cover_none + cover_full = cover_mask //----cover_full }; //----------------------------------------------------poly_subpixel_scale_e - // These constants determine the subpixel accuracy, to be more precise, - // the number of bits of the fractional part of the coordinates. + // These constants determine the subpixel accuracy, to be more precise, + // the number of bits of the fractional part of the coordinates. // The possible coordinate capacity in bits can be calculated by formula: // sizeof(int) * 8 - poly_subpixel_shift, i.e, for 32-bit integers and // 8-bits fractional part the capacity is 24 bits. enum poly_subpixel_scale_e { poly_subpixel_shift = 8, //----poly_subpixel_shift - poly_subpixel_scale = 1<<poly_subpixel_shift, //----poly_subpixel_scale - poly_subpixel_mask = poly_subpixel_scale-1, //----poly_subpixel_mask + poly_subpixel_scale = 1<<poly_subpixel_shift, //----poly_subpixel_scale + poly_subpixel_mask = poly_subpixel_scale-1 //----poly_subpixel_mask }; //----------------------------------------------------------filling_rule_e @@ -253,7 +253,7 @@ { return rad * 180.0 / pi; } - + //----------------------------------------------------------------rect_base template<class T> struct rect_base { @@ -265,9 +265,9 @@ rect_base(T x1_, T y1_, T x2_, T y2_) : x1(x1_), y1(y1_), x2(x2_), y2(y2_) {} - void init(T x1_, T y1_, T x2_, T y2_) + void init(T x1_, T y1_, T x2_, T y2_) { - x1 = x1_; y1 = y1_; x2 = x2_; y2 = y2_; + x1 = x1_; y1 = y1_; x2 = x2_; y2 = y2_; } const self_type& normalize() @@ -299,17 +299,17 @@ }; //-----------------------------------------------------intersect_rectangles - template<class Rect> + template<class Rect> inline Rect intersect_rectangles(const Rect& r1, const Rect& r2) { Rect r = r1; - // First process x2,y2 because the other order - // results in Internal Compiler Error under - // Microsoft Visual C++ .NET 2003 69462-335-0000007-18038 in + // First process x2,y2 because the other order + // results in Internal Compiler Error under + // Microsoft Visual C++ .NET 2003 69462-335-0000007-18038 in // case of "Maximize Speed" optimization option. //----------------- - if(r.x2 > r2.x2) r.x2 = r2.x2; + if(r.x2 > r2.x2) r.x2 = r2.x2; if(r.y2 > r2.y2) r.y2 = r2.y2; if(r.x1 < r2.x1) r.x1 = r2.x1; if(r.y1 < r2.y1) r.y1 = r2.y1; @@ -318,7 +318,7 @@ //---------------------------------------------------------unite_rectangles - template<class Rect> + template<class Rect> inline Rect unite_rectangles(const Rect& r1, const Rect& r2) { Rect r = r1; @@ -336,26 +336,26 @@ //---------------------------------------------------------path_commands_e enum path_commands_e { - path_cmd_stop = 0, //----path_cmd_stop - path_cmd_move_to = 1, //----path_cmd_move_to - path_cmd_line_to = 2, //----path_cmd_line_to - path_cmd_curve3 = 3, //----path_cmd_curve3 - path_cmd_curve4 = 4, //----path_cmd_curve4 + path_cmd_stop = 0, //----path_cmd_stop + path_cmd_move_to = 1, //----path_cmd_move_to + path_cmd_line_to = 2, //----path_cmd_line_to + path_cmd_curve3 = 3, //----path_cmd_curve3 + path_cmd_curve4 = 4, //----path_cmd_curve4 path_cmd_curveN = 5, //----path_cmd_curveN path_cmd_catrom = 6, //----path_cmd_catrom path_cmd_ubspline = 7, //----path_cmd_ubspline path_cmd_end_poly = 0x0F, //----path_cmd_end_poly - path_cmd_mask = 0x0F //----path_cmd_mask + path_cmd_mask = 0x0F //----path_cmd_mask }; //------------------------------------------------------------path_flags_e enum path_flags_e { - path_flags_none = 0, //----path_flags_none - path_flags_ccw = 0x10, //----path_flags_ccw - path_flags_cw = 0x20, //----path_flags_cw + path_flags_none = 0, //----path_flags_none + path_flags_ccw = 0x10, //----path_flags_ccw + path_flags_cw = 0x20, //----path_flags_cw path_flags_close = 0x40, //----path_flags_close - path_flags_mask = 0xF0 //----path_flags_mask + path_flags_mask = 0xF0 //----path_flags_mask }; //---------------------------------------------------------------is_vertex @@ -372,7 +372,7 @@ //-----------------------------------------------------------------is_stop inline bool is_stop(unsigned c) - { + { return c == path_cmd_stop; } @@ -416,7 +416,7 @@ inline bool is_close(unsigned c) { return (c & ~(path_flags_cw | path_flags_ccw)) == - (path_cmd_end_poly | path_flags_close); + (path_cmd_end_poly | path_flags_close); } //------------------------------------------------------------is_next_poly @@ -440,19 +440,19 @@ //-------------------------------------------------------------is_oriented inline bool is_oriented(unsigned c) { - return (c & (path_flags_cw | path_flags_ccw)) != 0; + return (c & (path_flags_cw | path_flags_ccw)) != 0; } //---------------------------------------------------------------is_closed inline bool is_closed(unsigned c) { - return (c & path_flags_close) != 0; + return (c & path_flags_close) != 0; } //----------------------------------------------------------get_close_flag inline unsigned get_close_flag(unsigned c) { - return c & path_flags_close; + return c & path_flags_close; } //-------------------------------------------------------clear_orientation @@ -513,7 +513,7 @@ int x1, x2; const T* ptr; const_row_info() {} - const_row_info(int x1_, int x2_, const T* ptr_) : + const_row_info(int x1_, int x2_, const T* ptr_) : x1(x1_), x2(x2_), ptr(ptr_) {} }; Added: branches/v0_99_maint/doc/pyplots/annotate_transform.py =================================================================== --- branches/v0_99_maint/doc/pyplots/annotate_transform.py (rev 0) +++ branches/v0_99_maint/doc/pyplots/annotate_transform.py 2009-08-15 17:56:44 UTC (rev 7490) @@ -0,0 +1,34 @@ +import numpy as np +import matplotlib.pyplot as plt + +x = np.arange(0, 10, 0.005) +y = np.exp(-x/2.) * np.sin(2*np.pi*x) + +fig = plt.figure() +ax = fig.add_subplot(111) +ax.plot(x, y) +ax.set_xlim(0, 10) +ax.set_ylim(-1, 1) + +xdata, ydata = 5, 0 +xdisplay, ydisplay = ax.transData.transform((xdata, ydata)) + +bbox = dict(boxstyle="round", fc="0.8") +arrowprops = dict( + arrowstyle = "->", + connectionstyle = "angle,angleA=0,angleB=90,rad=10") + +offset = 72 +ax.annotate('data = (%.1f, %.1f)'%(xdata, ydata), + (xdata, ydata), xytext=(-2*offset, offset), textcoords='offset points', + bbox=bbox, arrowprops=arrowprops) + + +disp = ax.annotate('display = (%.1f, %.1f)'%(xdisplay, ydisplay), + (xdisplay, ydisplay), xytext=(0.5*offset, -offset), + xycoords='figure pixels', + textcoords='offset points', + bbox=bbox, arrowprops=arrowprops) + + +plt.show() Copied: branches/v0_99_maint/doc/users/annotations_intro.rst (from rev 7489, branches/v0_99_maint/doc/users/annotations_overview.rst) =================================================================== --- branches/v0_99_maint/doc/users/annotations_intro.rst (rev 0) +++ branches/v0_99_maint/doc/users/annotations_intro.rst 2009-08-15 17:56:44 UTC (rev 7490) @@ -0,0 +1,87 @@ +.. _annotations-tutorial: + +Annotating text +=============== + +For a more detailed introduction to annotations, see +:ref:`plotting-guide-annotation`. + +The uses of the basic :func:`~matplotlib.pyplot.text` command above +place text at an arbitrary position on the Axes. A common use case of +text is to annotate some feature of the plot, and the +:func:`~matplotlib.Axes.annotate` method provides helper functionality +to make annotations easy. In an annotation, there are two points to +consider: the location being annotated represented by the argument +``xy`` and the location of the text ``xytext``. Both of these +arguments are ``(x,y)`` tuples. + +.. plot:: pyplots/annotation_basic.py + :include-source: + + +In this example, both the ``xy`` (arrow tip) and ``xytext`` locations +(text location) are in data coordinates. There are a variety of other +coordinate systems one can choose -- you can specify the coordinate +system of ``xy`` and ``xytext`` with one of the following strings for +``xycoords`` and ``textcoords`` (default is 'data') + +==================== ==================================================== +argument coordinate system +==================== ==================================================== + 'figure points' points from the lower left corner of the figure + 'figure pixels' pixels from the lower left corner of the figure + 'figure fraction' 0,0 is lower left of figure and 1,1 is upper, right + 'axes points' points from lower left corner of axes + 'axes pixels' pixels from lower left corner of axes + 'axes fraction' 0,1 is lower left of axes and 1,1 is upper right + 'data' use the axes data coordinate system +==================== ==================================================== + +For example to place the text coordinates in fractional axes +coordinates, one could do:: + + ax.annotate('local max', xy=(3, 1), xycoords='data', + xytext=(0.8, 0.95), textcoords='axes fraction', + arrowprops=dict(facecolor='black', shrink=0.05), + horizontalalignment='right', verticalalignment='top', + ) + +For physical coordinate systems (points or pixels) the origin is the +(bottom, left) of the figure or axes. If the value is negative, +however, the origin is from the (right, top) of the figure or axes, +analogous to negative indexing of sequences. + +Optionally, you can specify arrow properties which draws an arrow +from the text to the annotated point by giving a dictionary of arrow +properties in the optional keyword argument ``arrowprops``. + + +==================== ===================================================== +``arrowprops`` key description +==================== ===================================================== +width the width of the arrow in points +frac the fraction of the arrow length occupied by the head +headwidth the width of the base of the arrow head in points +shrink move the tip and base some percent away from + the annotated point and text + +\*\*kwargs any key for :class:`matplotlib.patches.Polygon`, + e.g. ``facecolor`` +==================== ===================================================== + + +In the example below, the ``xy`` point is in native coordinates +(``xycoords`` defaults to 'data'). For a polar axes, this is in +(theta, radius) space. The text in this example is placed in the +fractional figure coordinate system. :class:`matplotlib.text.Text` +keyword args like ``horizontalalignment``, ``verticalalignment`` and +``fontsize are passed from the `~matplotlib.Axes.annotate` to the +``Text`` instance + +.. plot:: pyplots/annotation_polar.py + :include-source: + +For more on all the wild and wonderful things you can do with +annotations, including fancy arrows, see :ref:`plotting-guide-annotation` +and :ref:`pylab_examples-annotation_demo`. + Deleted: branches/v0_99_maint/doc/users/annotations_overview.rst =================================================================== --- branches/v0_99_maint/doc/users/annotations_overview.rst 2009-08-15 17:40:27 UTC (rev 7489) +++ branches/v0_99_maint/doc/users/annotations_overview.rst 2009-08-15 17:56:44 UTC (rev 7490) @@ -1,87 +0,0 @@ -.. _annotations-tutorial: - -Annotating text -=============== - -For a more detailed introduction to annotations, see -:ref:`plotting-guide-annotation`. - -The uses of the basic :func:`~matplotlib.pyplot.text` command above -place text at an arbitrary position on the Axes. A common use case of -text is to annotate some feature of the plot, and the -:func:`~matplotlib.Axes.annotate` method provides helper functionality -to make annotations easy. In an annotation, there are two points to -consider: the location being annotated represented by the argument -``xy`` and the location of the text ``xytext``. Both of these -arguments are ``(x,y)`` tuples. - -.. plot:: pyplots/annotation_basic.py - :include-source: - - -In this example, both the ``xy`` (arrow tip) and ``xytext`` locations -(text location) are in data coordinates. There are a variety of other -coordinate systems one can choose -- you can specify the coordinate -system of ``xy`` and ``xytext`` with one of the following strings for -``xycoords`` and ``textcoords`` (default is 'data') - -==================== ==================================================== -argument coordinate system -==================== ==================================================== - 'figure points' points from the lower left corner of the figure - 'figure pixels' pixels from the lower left corner of the figure - 'figure fraction' 0,0 is lower left of figure and 1,1 is upper, right - 'axes points' points from lower left corner of axes - 'axes pixels' pixels from lower left corner of axes - 'axes fraction' 0,1 is lower left of axes and 1,1 is upper right - 'data' use the axes data coordinate system -==================== ==================================================== - -For example to place the text coordinates in fractional axes -coordinates, one could do:: - - ax.annotate('local max', xy=(3, 1), xycoords='data', - xytext=(0.8, 0.95), textcoords='axes fraction', - arrowprops=dict(facecolor='black', shrink=0.05), - horizontalalignment='right', verticalalignment='top', - ) - -For physical coordinate systems (points or pixels) the origin is the -(bottom, left) of the figure or axes. If the value is negative, -however, the origin is from the (right, top) of the figure or axes, -analogous to negative indexing of sequences. - -Optionally, you can specify arrow properties which draws an arrow -from the text to the annotated point by giving a dictionary of arrow -properties in the optional keyword argument ``arrowprops``. - - -==================== ===================================================== -``arrowprops`` key description -==================== ===================================================== -width the width of the arrow in points -frac the fraction of the arrow length occupied by the head -headwidth the width of the base of the arrow head in points -shrink move the tip and base some percent away from - the annotated point and text - -\*\*kwargs any key for :class:`matplotlib.patches.Polygon`, - e.g. ``facecolor`` -==================== ===================================================== - - -In the example below, the ``xy`` point is in native coordinates -(``xycoords`` defaults to 'data'). For a polar axes, this is in -(theta, radius) space. The text in this example is placed in the -fractional figure coordinate system. :class:`matplotlib.text.Text` -keyword args like ``horizontalalignment``, ``verticalalignment`` and -``fontsize are passed from the `~matplotlib.Axes.annotate` to the -``Text`` instance - -.. plot:: pyplots/annotation_polar.py - :include-source: - -For more on all the wild and wonderful things you can do with -annotations, including fancy arrows, see :ref:`plotting-guide-annotation` -and :ref:`pylab_examples-annotation_demo`. - Modified: branches/v0_99_maint/doc/users/index.rst =================================================================== --- branches/v0_99_maint/doc/users/index.rst 2009-08-15 17:40:27 UTC (rev 7489) +++ branches/v0_99_maint/doc/users/index.rst 2009-08-15 17:56:44 UTC (rev 7490) @@ -22,7 +22,7 @@ artists.rst legend_guide.rst event_handling.rst - annotation_guide.rst + annotations_guide.rst legend.rst transforms_tutorial.rst toolkits.rst Deleted: branches/v0_99_maint/doc/users/legend.rst =================================================================== --- branches/v0_99_maint/doc/users/legend.rst 2009-08-15 17:40:27 UTC (rev 7489) +++ branches/v0_99_maint/doc/users/legend.rst 2009-08-15 17:56:44 UTC (rev 7490) @@ -1,182 +0,0 @@ -.. _plotting-guide-legend: - -************ -Legend guide -************ - -Do not proceed unless you already have read :func:`~matplotlib.pyplot.legend` and -:class:`matplotlib.legend.Legend`! - - -What to be displayed -==================== - -The legend command has a following call signature:: - - legend(*args, **kwargs) - -If len(args) is 2, the first argument should be a list of artist to be -labeled, and the second argument should a list of string labels. If -len(args) is 0, it automatically generate the legend from label -properties of the child artists by calling -:meth:`~matplotlib.axes.Axes.get_legend_handles_labels` method. -For example, *ax.legend()* is equivalent to:: - - handles, labels = ax.get_legend_handles_labels() - ax.legend(handles, labels) - -The :meth:`~matplotlib.axes.Axes.get_legend_handles_labels` method -returns a tuple of two lists, i.e., list of artists and list of labels -(python string). However, it does not return all of its child -artists. It returns all artists in *ax.lines* and *ax.patches* and -some artists in *ax.collection* which are instance of -:class:`~matplotlib.collections.LineCollection` or -:class:`~matplotlib.collections.RegularPolyCollection`. The label -attributes (returned by get_label() method) of collected artists are -used as text labels. If label attribute is empty string or starts with -"_", that artist will be ignored. - - - * Note that not all kind of artists are supported by the legend. The - following is the list of artists that are currently supported. - - * :class:`~matplotlib.lines.Line2D` - * :class:`~matplotlib.patches.Patch` - * :class:`~matplotlib.collections.LineCollection` - * :class:`~matplotlib.collections.RegularPolyCollection` - - Unfortunately, there is no easy workaround when you need legend for - an artist not in the above list (You may use one of the supported - artist as a proxy. See below), or customize it beyond what is - supported by :class:`matplotlib.legend.Legend`. - - * Remember that some *pyplot* commands return artist not supported by - legend, e.g., :func:`~matplotlib.pyplot.fill_between` returns - :class:`~matplotlib.collections.PolyCollection` that is not - supported. Or some return multiple artists. For example, - :func:`~matplotlib.pyplot.plot` returns list of - :class:`~matplotlib.lines.Line2D` instances, and - :func:`~matplotlib.pyplot.errorbar` returns a length 3 tuple of - :class:`~matplotlib.lines.Line2D` instances. - - * The legend does not care about the axes that given artists belongs, - i.e., the artists may belong to other axes or even none. - - -Adjusting the Order of Legend items ------------------------------------ - -When you want to customize the list of artists to be displayed in the -legend, or their order of appearance. There are a two options. First, -you can keep lists of artists and labels, and explicitly use these for -the first two argument of the legend call.:: - - p1, = plot([1,2,3]) - p2, = plot([3,2,1]) - p3, = plot([2,3,1]) - legend([p2, p1], ["line 2", "line 1"]) - -Or you may use :meth:`~matplotlib.axes.Axes.get_legend_handles_labels` -to retrieve list of artist and labels and manipulate them before -feeding them to legend call.:: - - ax = subplot(1,1,1) - p1, = ax.plot([1,2,3], label="line 1") - p2, = ax.plot([3,2,1], label="line 2") - p3, = ax.plot([2,3,1], label="line 3") - - handles, labels = ax.get_legend_handles_labels() - - # reverse the order - ax.legend(handles[::-1], labels[::-1]) - - # or sort them by labels - import operator - hl = sorted(zip(handles, labels), - key=operator.itemgetter(1)) - handles2, labels2 = zip(*hl) - - ax.legend(handles2, labels2) - - -Using Proxy Artist ------------------- - -When you want to display legend for an artist not supported by the -matplotlib, you may use other supported artist as a proxy. For -example, you may creates an proxy artist without adding it to the axes -(so the proxy artist will not be drawn in the main axes) and feet it -to the legend function.:: - - p = Rectangle((0, 0), 1, 1, fc="r") - legend([p], ["Red Rectangle"]) - - -Multicolumn Legend -================== - -By specifying the keyword argument *ncol*, you can have a multi-column -legend. Also, mode="expand" horizontally expand the legend to fill the -axes area. See `legend_demo3.py -<http://matplotlib.sourceforge.net/examples/pylab_examples/legend_demo3.html>`_ -for example. - - -Legend location -=============== - -The location of the legend can be specified by the keyword argument -*loc*, either by string or a integer number. - -============= ====== - String Number -============= ====== - upper right 1 - upper left 2 - lower left 3 - lower right 4 - right 5 - center left 6 - center right 7 - lower center 8 - upper center 9 - center 10 -============= ====== - -By default, the legend will anchor to the bbox of the axes -(for legend) or the bbox of the figure (figlegend). You can specify -your own bbox using *bbox_to_anchor* argument. *bbox_to_anchor* can be an -instance of :class:`~matplotlib.transforms.BboxBase`, a tuple of 4 -floats (x, y, width, height of the bbox), or a tuple of 2 floats (x, y -with width=height=0). Unless *bbox_transform* argument is given, the -coordinates (even for the bbox instance) are considered as normalized -axes coordinates. - -For example, if you want your axes legend located at the figure corner -(instead of the axes corner):: - - l = legend(bbox_to_anchor=(0, 0, 1, 1), transform=gcf().transFigure) - -Also, you can place above or outer right-hand side of the axes, - -.. plot:: users/plotting/examples/simple_legend01.py - :include-source: - - -Multiple Legend -=============== - -Sometime, you want to split the legend into multiple ones.:: - - p1, = plot([1,2,3]) - p2, = plot([3,2,1]) - legend([p1], ["Test1"], loc=1) - legend([p2], ["Test2"], loc=4) - -However, the above code only shows the second legend. When the legend -command is called, a new legend instance is created and old ones are -removed from the axes. Thus, you need to manually add the removed -legend. - -.. plot:: users/plotting/examples/simple_legend02.py - :include-source: Copied: branches/v0_99_maint/doc/users/legend_guide.rst (from rev 7489, branches/v0_99_maint/doc/users/legend.rst) =================================================================== --- branches/v0_99_maint/doc/users/legend_guide.rst (rev 0) +++ branches/v0_99_maint/doc/users/legend_guide.rst 2009-08-15 17:56:44 UTC (rev 7490) @@ -0,0 +1,182 @@ +.. _plotting-guide-legend: + +************ +Legend guide +************ + +Do not proceed unless you already have read :func:`~matplotlib.pyplot.legend` and +:class:`matplotlib.legend.Legend`! + + +What to be displayed +==================== + +The legend command has a following call signature:: + + legend(*args, **kwargs) + +If len(args) is 2, the first argument should be a list of artist to be +labeled, and the second argument should a list of string labels. If +len(args) is 0, it automatically generate the legend from label +properties of the child artists by calling +:meth:`~matplotlib.axes.Axes.get_legend_handles_labels` method. +For example, *ax.legend()* is equivalent to:: + + handles, labels = ax.get_legend_handles_labels() + ax.legend(handles, labels) + +The :meth:`~matplotlib.axes.Axes.get_legend_handles_labels` method +returns a tuple of two lists, i.e., list of artists and list of labels +(python string). However, it does not return all of its child +artists. It returns all artists in *ax.lines* and *ax.patches* and +some artists in *ax.collection* which are instance of +:class:`~matplotlib.collections.LineCollection` or +:class:`~matplotlib.collections.RegularPolyCollection`. The label +attributes (returned by get_label() method) of collected artists are +used as text labels. If label attribute is empty string or starts with +"_", that artist will be ignored. + + + * Note that not all kind of artists are supported by the legend. The + following is the list of artists that are currently supported. + + * :class:`~matplotlib.lines.Line2D` + * :class:`~matplotlib.patches.Patch` + * :class:`~matplotlib.collections.LineCollection` + * :class:`~matplotlib.collections.RegularPolyCollection` + + Unfortunately, there is no easy workaround when you need legend for + an artist not in the above list (You may use one of the supported + artist as a proxy. See below), or customize it beyond what is + supported by :class:`matplotlib.legend.Legend`. + + * Remember that some *pyplot* commands return artist not supported by + legend, e.g., :func:`~matplotlib.pyplot.fill_between` returns + :class:`~matplotlib.collections.PolyCollection` that is not + supported. Or some return multiple artists. For example, + :func:`~matplotlib.pyplot.plot` returns list of + :class:`~matplotlib.lines.Line2D` instances, and + :func:`~matplotlib.pyplot.errorbar` returns a length 3 tuple of + :class:`~matplotlib.lines.Line2D` instances. + + * The legend does not care about the axes that given artists belongs, + i.e., the artists may belong to other axes or even none. + + +Adjusting the Order of Legend items +----------------------------------- + +When you want to customize the list of artists to be displayed in the +legend, or their order of appearance. There are a two options. First, +you can keep lists of artists and labels, and explicitly use these for +the first two argument of the legend call.:: + + p1, = plot([1,2,3]) + p2, = plot([3,2,1]) + p3, = plot([2,3,1]) + legend([p2, p1], ["line 2", "line 1"]) + +Or you may use :meth:`~matplotlib.axes.Axes.get_legend_handles_labels` +to retrieve list of artist and labels and manipulate them before +feeding them to legend call.:: + + ax = subplot(1,1,1) + p1, = ax.plot([1,2,3], label="line 1") + p2, = ax.plot([3,2,1], label="line 2") + p3, = ax.plot([2,3,1], label="line 3") + + handles, labels = ax.get_legend_handles_labels() + + # reverse the order + ax.legend(handles[::-1], labels[::-1]) + + # or sort them by labels + import operator + hl = sorted(zip(handles, labels), + key=operator.itemgetter(1)) + handles2, labels2 = zip(*hl) + + ax.legend(handles2, labels2) + + +Using Proxy Artist +------------------ + +When you want to display legend for an artist not supported by the +matplotlib, you may use other supported artist as a proxy. For +example, you may creates an proxy artist without adding it to the axes +(so the proxy artist will not be drawn in the main axes) and feet it +to the legend function.:: + + p = Rectangle((0, 0), 1, 1, fc="r") + legend([p], ["Red Rectangle"]) + + +Multicolumn Legend +================== + +By specifying the keyword argument *ncol*, you can have a multi-column +legend. Also, mode="expand" horizontally expand the legend to fill the +axes area. See `legend_demo3.py +<http://matplotlib.sourceforge.net/examples/pylab_examples/legend_demo3.html>`_ +for example. + + +Legend location +=============== + +The location of the legend can be specified by the keyword argument +*loc*, either by string or a integer number. + +============= ====== + String Number +============= ====== + upper right 1 + upper left 2 + lower left 3 + lower right 4 + right 5 + center left 6 + center right 7 + lower center 8 + upper center 9 + center 10 +============= ====== + +By default, the legend will anchor to the bbox of the axes +(for legend) or the bbox of the figure (figlegend). You can specify +your own bbox using *bbox_to_anchor* argument. *bbox_to_anchor* can be an +instance of :class:`~matplotlib.transforms.BboxBase`, a tuple of 4 +floats (x, y, width, height of the bbox), or a tuple of 2 floats (x, y +with width=height=0). Unless *bbox_transform* argument is given, the +coordinates (even for the bbox instance) are considered as normalized +axes coordinates. + +For example, if you want your axes legend located at the figure corner +(instead of the axes corner):: + + l = legend(bbox_to_anchor=(0, 0, 1, 1), transform=gcf().transFigure) + +Also, you can place above or outer right-hand side of the axes, + +.. plot:: users/plotting/examples/simple_legend01.py + :include-source: + + +Multiple Legend +=============== + +Sometime, you want to split the legend into multiple ones.:: + + p1, = plot([1,2,3]) + p2, = plot([3,2,1]) + legend([p1], ["Test1"], loc=1) + legend([p2], ["Test2"], loc=4) + +However, the above code only shows the second legend. When the legend +command is called, a new legend instance is created and old ones are +removed from the axes. Thus, you need to manually add the removed +legend. + +.. plot:: users/plotting/examples/simple_legend02.py + :include-source: Modified: branches/v0_99_maint/doc/users/transforms_tutorial.rst =================================================================== --- branches/v0_99_maint/doc/users/transforms_tutorial.rst 2009-08-15 17:40:27 UTC (rev 7489) +++ branches/v0_99_maint/doc/users/transforms_tutorial.rst 2009-08-15 17:56:44 UTC (rev 7490) @@ -12,7 +12,7 @@ happens under the hood, but as you push the limits of custom figure generation, it helps to have an understanding of these objects so you can reuse the existing transformations matplotlib makes available to -you, or create your own. The table below summarizes the existing +you, or create your own (see :mod:`matplotlib.transforms`. The table below summarizes the existing coordinate systems, the transformation object you should use to work in that coordinate system, and the description of that system. In the `Transformation Object` column, ``ax`` is a :class:`~matplotlib.axes.Axes` instance, @@ -276,7 +276,8 @@ it, adjusting the zorder to make sure the shadow is drawn first and then the object it is shadowing above it. The transforms module has a helper transformation -:class:~matplotlib.tranasforms.ScaledTranslation`. It is instantiated with:: +:class:`~matplotlib.transforms.ScaledTranslation`. It is +instantiated with:: trans = ScaledTranslation(xt, yt, scale_trans) @@ -287,7 +288,7 @@ to first scale `xty and `yt` specified in points to `display` space before doing the final offset. The dpi and inches offset is a common-enough use case that we have a special helper function to -create it in :func:`~matplotlib.transforms.offset_copy`, which returns +create it in :func:`matplotlib.transforms.offset_copy`, which returns a new transform with an added offset. But in the example below, we'll create the offset trransform ourselves. Note the use of the plus operator in:: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-22 00:02:28
|
Revision: 7517 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7517&view=rev Author: jdh2358 Date: 2009-08-22 00:02:15 +0000 (Sat, 22 Aug 2009) Log Message: ----------- fixed a fifo bug for the new transforms infrastructure Modified Paths: -------------- branches/v0_99_maint/doc/users/index.rst branches/v0_99_maint/lib/matplotlib/mlab.py Modified: branches/v0_99_maint/doc/users/index.rst =================================================================== --- branches/v0_99_maint/doc/users/index.rst 2009-08-21 18:35:47 UTC (rev 7516) +++ branches/v0_99_maint/doc/users/index.rst 2009-08-22 00:02:15 UTC (rev 7517) @@ -22,10 +22,10 @@ artists.rst legend_guide.rst event_handling.rst - annotations_guide.rst legend.rst transforms_tutorial.rst path_tutorial.rst + annotations_guide.rst toolkits.rst screenshots.rst whats_new.rst Modified: branches/v0_99_maint/lib/matplotlib/mlab.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/mlab.py 2009-08-21 18:35:47 UTC (rev 7516) +++ branches/v0_99_maint/lib/matplotlib/mlab.py 2009-08-22 00:02:15 UTC (rev 7517) @@ -1099,8 +1099,9 @@ Add scalar *x* and *y* to the queue. """ if self.dataLim is not None: - xys = ((x,y),) - self.dataLim.update(xys, -1) #-1 means use the default ignore setting + xy = np.asarray([(x,y),]) + self.dataLim.update_from_data_xy(xy, None) + ind = self._ind % self._nmax #print 'adding to fifo:', ind, x, y self._xs[ind] = x @@ -1144,6 +1145,8 @@ if self.dataLim is None: raise ValueError('You must first set the dataLim attr') x, y = self.asarrays() + self.dataLim.update_from_data(x, y, True) + self.dataLim.update_numerix(x, y, True) def movavg(x,n): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2009-08-22 06:25:16
|
Revision: 7519 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7519&view=rev Author: jouni Date: 2009-08-22 06:25:07 +0000 (Sat, 22 Aug 2009) Log Message: ----------- Fix typos found by Marc Desmarais and Nicolas Pinto Modified Paths: -------------- branches/v0_99_maint/doc/users/artists.rst branches/v0_99_maint/lib/matplotlib/axes.py Modified: branches/v0_99_maint/doc/users/artists.rst =================================================================== --- branches/v0_99_maint/doc/users/artists.rst 2009-08-22 04:19:45 UTC (rev 7518) +++ branches/v0_99_maint/doc/users/artists.rst 2009-08-22 06:25:07 UTC (rev 7519) @@ -37,7 +37,7 @@ :class:`~matplotlib.text.Text`, :class:`~matplotlib.patches.Rectangle`, :class:`~matplotlib.image.Image`, respectively). These helper methods -will take your data (eg. ``numpy`` arrays and strings) create +will take your data (eg. ``numpy`` arrays and strings) and create primitive ``Artist`` instances as needed (eg. ``Line2D``), add them to the relevant containers, and draw them when requested. Most of you are probably familiar with the :class:`~matplotlib.axes.Subplot`, Modified: branches/v0_99_maint/lib/matplotlib/axes.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/axes.py 2009-08-22 04:19:45 UTC (rev 7518) +++ branches/v0_99_maint/lib/matplotlib/axes.py 2009-08-22 06:25:07 UTC (rev 7519) @@ -3828,7 +3828,7 @@ """ return handles and labels for legend - ax.legend() is equibalent to :: + ax.legend() is equivalent to :: h, l = ax.get_legend_handles_labels() ax.legend(h, l) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-22 22:51:03
|
Revision: 7521 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7521&view=rev Author: jdh2358 Date: 2009-08-22 22:50:55 +0000 (Sat, 22 Aug 2009) Log Message: ----------- added Ariel's max install patch Modified Paths: -------------- branches/v0_99_maint/doc/faq/installing_faq.rst branches/v0_99_maint/lib/matplotlib/mlab.py Modified: branches/v0_99_maint/doc/faq/installing_faq.rst =================================================================== --- branches/v0_99_maint/doc/faq/installing_faq.rst 2009-08-22 20:16:09 UTC (rev 7520) +++ branches/v0_99_maint/doc/faq/installing_faq.rst 2009-08-22 22:50:55 UTC (rev 7521) @@ -295,8 +295,8 @@ If you want to install matplotlib from one of the binary installers we build, you have two choices: a dmg installer, which is a typical Installer.app, or an binary OSX egg, which you can install via -setuptools easy_install. - +setuptools easy_install. + The mkpg installer will have a "dmg" extension, and will have a name like :file:`matplotlib-0.99.0-py2.5-macosx10.5.dmg` depending on the python, matplotlib, and OSX versions. Save this file and double @@ -318,10 +318,24 @@ then you will need to set your PYTHONPATH, eg:: - export PYTHONPATH=/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages:$PYTHONPATH + export PYTHONPATH=/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages:$PYTHONPATH See also :ref:`environment-variables`. + +If you are upgrading your matplotlib using the dmg installer over an +Enthought Python Distribution, you may get an error like "You must use +a framework install of python". EPD puts their python in a directory +like :file:``//Library/Frameworks/Python.framework/Versions/4.3.0`` +where 4.3.0 is an EPD version number. The mpl installer needs the +`python` version number, so you need to create a symlink pointing your +python version to the EPS version before installing matplotlib. For +example, for python veersion 2.5 and EPD version 4.3.0:: + + > cd /Library/Frameworks/Python.framework/Versions + > ln -s 4.3.0 2.5 + + .. _easy-install-osx-egg: easy_install from egg @@ -342,7 +356,7 @@ <http://sourceforge.net/projects/matplotlib/files/>`_ directly to your harddrive, and manually install it with - > easy_install --install-dir=~/dev/lib/python2.5/site-packages/ matplotlib-0.99.0.rc1-py2.5-macosx-10.5-i386.egg + > easy_install --install-dir=~/dev/lib/python2.5/site-packages/ matplotlib-0.99.0.rc1-py2.5-macosx-10.5-i386.egg Some users have reported problems with the egg for 0.98 from the @@ -364,6 +378,65 @@ which prevents their installation through easy_install. Renaming is all it takes to install them; still, it's annoying. + +.. _install_from_source_on_osx_epd: + +Building and installing from source on OSX with EPD +--------------------------------------------------- + +If you have the EPD installed (:ref:`which-python-for-osx`), it might turn out +to be rather tricky to install a new version of matplotlib from source on the +Mac OS 10.5 . Here's a procedure that seems to work, at least sometimes: + +0. Remove the ~/.matplotlib folder ("rm -rf ~/.matplotlib"). + +1. Edit the file (make a backup before you start, just in case): +``/Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/config/Makefile``, +removing all occurrences of the string ``-arch ppc``, changing the line +``MACOSX_DEPLOYMENT_TARGET=10.3`` to ``MACOSX_DEPLOYMENT_TARGET=10.5`` and +changing the occurrences of ``MacOSX10.4u.sdk`` into ``MacOSX10.5.sdk`` + +2. In +``/Library/Frameworks/Python.framework/Versions/Current/lib/pythonX.Y/site-packages/easy-install.pth``, +(where X.Y is the version of Python you are building against) +Comment out the line containing the name of the directory in which the +previous version of MPL was installed (Looks something like ``./matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg``). + +3. Save the following as a shell script , for example ``./install-matplotlib-epd-osx.sh`` :: + NAME=matplotlib + VERSION=0_99 + PREFIX=$HOME + #branch="release" + branch="trunk" + if [ $branch = "trunk" ] + then + echo getting the trunk + svn co https://matplotlib.svn.sourceforge.net/svnroot/$NAME/trunk/$NAME $NAME + cd $NAME + + fi + if [ $branch = "release" ] + then + echo getting the maintenance branch + svn co https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v${VERSION}_maint $NAME$VERSION + cd $NAME$VERSION + fi + export CFLAGS="-Os -arch i386" + export LDFLAGS="-Os -arch i386" + export PKG_CONFIG_PATH="/usr/x11/lib/pkgconfig" + export ARCHFLAGS="-arch i386" + python setup.py build + python setup.py install #--prefix=$PREFIX #Use this if you don't want it installed into your default location + cd .. + +Run this script (for example ``sh ./install-matplotlib-epd-osx.sh``) in the +directory in which you want the source code to be placed, or simply type the +commands in the terminal command line. This script sets some local variable +(CFLAGS, LDFLAGS, PKG_CONFIG_PATH, ARCHFLAGS), removes previous installations, +checks out the source from svn, builds and installs it. The backend seems to be +set to MacOSX. + + Windows questions ================= Modified: branches/v0_99_maint/lib/matplotlib/mlab.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/mlab.py 2009-08-22 20:16:09 UTC (rev 7520) +++ branches/v0_99_maint/lib/matplotlib/mlab.py 2009-08-22 22:50:55 UTC (rev 7521) @@ -565,7 +565,7 @@ For an example script that shows that this :func:`cohere_pairs` and :func:`cohere` give the same results for a given pair. - """ + """ numRows, numCols = X.shape # zero pad if X is too short This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-23 02:27:51
|
Revision: 7533 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7533&view=rev Author: jdh2358 Date: 2009-08-23 02:27:44 +0000 (Sun, 23 Aug 2009) Log Message: ----------- tweaks to os x Modified Paths: -------------- branches/v0_99_maint/Makefile branches/v0_99_maint/make.osx Added Paths: ----------- branches/v0_99_maint/README.osx Modified: branches/v0_99_maint/Makefile =================================================================== --- branches/v0_99_maint/Makefile 2009-08-23 02:16:27 UTC (rev 7532) +++ branches/v0_99_maint/Makefile 2009-08-23 02:27:44 UTC (rev 7533) @@ -28,10 +28,13 @@ tar cvfz pyback.tar.gz *.py lib src examples/*.py unit/*.py -build_osx105: +_build_osx105: CFLAGS="-Os -arch i386 -arch ppc" LDFLAGS="-Os -arch i386 -arch ppc" python setup.py build +build_osx105: + echo "Use 'make -f fetch deps mpl_install instead'" + jdh_doc_snapshot: svn up;\ python setup.py install --prefix=~/dev;\ Added: branches/v0_99_maint/README.osx =================================================================== --- branches/v0_99_maint/README.osx (rev 0) +++ branches/v0_99_maint/README.osx 2009-08-23 02:27:44 UTC (rev 7533) @@ -0,0 +1,13 @@ +Build mpl on OSX has proven to be a nightmare because of all the +different types of zlib, png and freetype that may be on your system. +The recommended and supported way to build is to use the make.osx file +in this directory. This script requires you to set a PREFIX +environment variable where you want to the install to go. It will +fetch the dependencies from a remove server and install them into your +PREFIX dir, and then build mpl against them. It should ignore any +lib, png or freetype on your system + +Example usage:: + + PREFIX=/Users/jdhunter/dev make -f make.osx fetch deps mpl_install + Modified: branches/v0_99_maint/make.osx =================================================================== --- branches/v0_99_maint/make.osx 2009-08-23 02:16:27 UTC (rev 7532) +++ branches/v0_99_maint/make.osx 2009-08-23 02:27:44 UTC (rev 7533) @@ -1,13 +1,11 @@ -PREFIX=/Users/jdh2358/dev +# build mpl into a local install dir with +# PREFIX=/Users/jdhunter/dev make -f make.osx fetch deps mpl_install + PYVERSION=2.6 PYTHON=python${PYVERSION} -SRCDIR=${PWD} ZLIBVERSION=1.2.3 PNGVERSION=1.2.33 FREETYPEVERSION=2.3.7 -MPLVERSION=0.99.0 -BDISTMPKGVERSION=0.4.4 -MPLSRC=matplotlib-${MPLVERSION} MACOSX_DEPLOYMENT_TARGET=10.4 ## You shouldn't need to configure past this point @@ -26,9 +24,9 @@ zlib-${ZLIBVERSION} libpng-${PNGVERSION} freetype-${FREETYPEVERSION} fetch: - python -c 'import urllib; urllib.urlretrieve("http://www.zlib.net/zlib-${ZLIBVERSION}.tar.gz", "zlib-${ZLIBVERSION}.tar.gz")' &&\ - python -c 'import urllib; urllib.urlretrieve("http://internap.dl.sourceforge.net/sourceforge/libpng/libpng-${PNGVERSION}.tar.bz2", "libpng-${PNGVERSION}.tar.bz2")' &&\ - python -c 'import urllib; urllib.urlretrieve("http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPEVERSION}.tar.bz2", "freetype-${FREETYPEVERSION}.tar.bz2")' + ${PYTHON} -c 'import urllib; urllib.urlretrieve("http://www.zlib.net/zlib-${ZLIBVERSION}.tar.gz", "zlib-${ZLIBVERSION}.tar.gz")' &&\ + ${PYTHON} -c 'import urllib; urllib.urlretrieve("http://internap.dl.sourceforge.net/sourceforge/libpng/libpng-${PNGVERSION}.tar.bz2", "libpng-${PNGVERSION}.tar.bz2")' &&\ + ${PYTHON} -c 'import urllib; urllib.urlretrieve("http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPEVERSION}.tar.bz2", "freetype-${FREETYPEVERSION}.tar.bz2")' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-23 05:28:02
|
Revision: 7536 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7536&view=rev Author: jdh2358 Date: 2009-08-23 05:27:40 +0000 (Sun, 23 Aug 2009) Log Message: ----------- fix some typos in the docs Modified Paths: -------------- branches/v0_99_maint/doc/users/annotations_guide.rst branches/v0_99_maint/doc/users/event_handling.rst branches/v0_99_maint/doc/users/installing.rst branches/v0_99_maint/doc/users/path_tutorial.rst branches/v0_99_maint/doc/users/shell.rst branches/v0_99_maint/doc/users/transforms_tutorial.rst Added Paths: ----------- branches/v0_99_maint/examples/animation/animate_decay_tk_blit.py Modified: branches/v0_99_maint/doc/users/annotations_guide.rst =================================================================== --- branches/v0_99_maint/doc/users/annotations_guide.rst 2009-08-23 05:18:45 UTC (rev 7535) +++ branches/v0_99_maint/doc/users/annotations_guide.rst 2009-08-23 05:27:40 UTC (rev 7536) @@ -4,7 +4,7 @@ Annotating Axes **************** -Do not proceed unless you already have read +Do not proceed unless you already have read :func:`~matplotlib.pyplot.text` and :func:`~matplotlib.pyplot.annotate`! @@ -38,7 +38,7 @@ bb.set_boxstyle("rarrow", pad=0.6) The arguments are the name of the box style with its attributes as -keyword arguments. Currently, followign box styles are implemented. +keyword arguments. Currently, following box styles are implemented. ========== ============== ========================== Class Name Attrs @@ -55,7 +55,7 @@ .. plot:: mpl_examples/pylab_examples/fancybox_demo2.py -Note that the attrubutes arguments can be specified within the style +Note that the attributes arguments can be specified within the style name with separating comma (this form can be used as "boxstyle" value of bbox argument when initializing the text instance) :: @@ -103,7 +103,7 @@ 2. If patch object is given (*patchA* & *patchB*), the path is clipped to avoid the patch. -3. The path is further shrinked by given amount of pixels (*shirnkA* +3. The path is further shrunk by given amount of pixels (*shirnkA* & *shrinkB*) 4. The path is transmuted to arrow patch, which is controlled by the @@ -114,7 +114,7 @@ The creation of the connecting path between two points is controlled by -``connectionstyle`` key and follwing styles are available. +``connectionstyle`` key and following styles are available. ========== ============================================= Name Attrs @@ -197,7 +197,7 @@ ax2.add_artist(con) The above code connects point xy in data coordinate of ``ax1`` to -point xy int data coordiante of ``ax2``. Here is a simple example. +point xy int data coordinate of ``ax2``. Here is a simple example. .. plot:: users/plotting/examples/connect_simple01.py @@ -230,7 +230,7 @@ The *loc* keyword has same meaning as in the legend command. A simple application is when the size of the artist (or collection of -artists) is knwon in pixel size during the time of creation. For +artists) is known in pixel size during the time of creation. For example, If you want to draw a circle with fixed size of 20 pixel x 20 pixel (radius = 10 pixel), you can utilize ``AnchoredDrawingArea``. The instance is created with a size of the @@ -280,7 +280,7 @@ .. plot:: users/plotting/examples/anchored_box04.py Note that unlike the legend, the ``bbox_transform`` is set -to IdentityTransform by default. +to IdentityTransform by default. Advanced Topics *************** @@ -288,7 +288,7 @@ Zoom effect between Axes ======================== -mpl_toolkits.axes_grid.inset_locator defines some patch classs useful +mpl_toolkits.axes_grid.inset_locator defines some patch classes useful for interconnect two axes. Understanding the code requires some knowledge of how mpl's transform works. But, utilizing it will be straight forward. @@ -327,6 +327,6 @@ :include-source: -Similarly, you can define custom ConnectionStyle and Custome ArrowStyle. +Similarly, you can define custom ConnectionStyle and custom ArrowStyle. See the source code of ``lib/matplotlib/patches.py`` and check how each style class is defined. Modified: branches/v0_99_maint/doc/users/event_handling.rst =================================================================== --- branches/v0_99_maint/doc/users/event_handling.rst 2009-08-23 05:18:45 UTC (rev 7535) +++ branches/v0_99_maint/doc/users/event_handling.rst 2009-08-23 05:27:40 UTC (rev 7536) @@ -5,7 +5,7 @@ ************************** matplotlib works with 6 user interface toolkits (wxpython, tkinter, -qt, gtk, fltk abd macosx) and in order to support features like interactive +qt, gtk, fltk and macosx) and in order to support features like interactive panning and zooming of figures, it is helpful to the developers to have an API for interacting with the figure via key presses and mouse movements that is "GUI neutral" so we don't have to repeat a lot of @@ -150,7 +150,7 @@ Write draggable rectangle class that is initialized with a :class:`~matplotlib.patches.Rectangle` instance but will move its x,y -location when dragged. Hint: you will need to store the orginal +location when dragged. Hint: you will need to store the original ``xy`` location of the rectangle which is stored as rect.xy and connect to the press, motion and release mouse events. When the mouse is pressed, check to see if the click occurs over your rectangle (see Modified: branches/v0_99_maint/doc/users/installing.rst =================================================================== --- branches/v0_99_maint/doc/users/installing.rst 2009-08-23 05:18:45 UTC (rev 7535) +++ branches/v0_99_maint/doc/users/installing.rst 2009-08-23 05:27:40 UTC (rev 7536) @@ -22,7 +22,7 @@ One single click installer and you are done. -Ok, so you want to do it the hard way? +OK, so you want to do it the hard way? ====================================== For some people, the prepackaged pythons discussed above are not an @@ -109,7 +109,7 @@ packaging matplotlib. -.. _install_requrements: +.. _install_requirements: Build requirements ================== @@ -152,7 +152,7 @@ The Qt3 widgets library python wrappers for the QtAgg backend :term:`pyqt` 4.0 or later - The Qt4 widgets library python wrappersfor the Qt4Agg backend + The Qt4 widgets library python wrappers for the Qt4Agg backend :term:`pygtk` 2.2 or later The python wrappers for the GTK widgets library for use with the GTK or GTKAgg backend @@ -201,5 +201,5 @@ instruction in the README. This directory has a Makefile which will automatically grab the zlib, png and freetype dependencies from the web, build them with the right flags to make universal libraries, and -then build the matplotlib source and binary installers. - \ No newline at end of file +then build the matplotlib source and binary installers. + Modified: branches/v0_99_maint/doc/users/path_tutorial.rst =================================================================== --- branches/v0_99_maint/doc/users/path_tutorial.rst 2009-08-23 05:18:45 UTC (rev 7535) +++ branches/v0_99_maint/doc/users/path_tutorial.rst 2009-08-23 05:27:40 UTC (rev 7536) @@ -71,7 +71,7 @@ control point and one end point, and CURVE4 has three vertices for the two control points and the end point. The example below shows a CURVE4 Bézier spline -- the bézier curve will be contained in the -convex hul of the start point, the two control points, and the end +convex hull of the start point, the two control points, and the end point .. plot:: @@ -123,7 +123,7 @@ like :meth:`~matplotlib.axes.Axes.hist` and :meth:`~matplotlib.axes.Axes.bar`, which create a number of primitives, eg a bunch of Rectangles, can usually be implemented more -efficiently using a compund path. The reason ``bar`` creates a list +efficiently using a compound path. The reason ``bar`` creates a list of rectangles and not a compound path is largely historical: the :class:`~matplotlib.path.Path` code is comparatively new and ``bar`` predates it. While we could change it now, it would break old code, Modified: branches/v0_99_maint/doc/users/shell.rst =================================================================== --- branches/v0_99_maint/doc/users/shell.rst 2009-08-23 05:18:45 UTC (rev 7535) +++ branches/v0_99_maint/doc/users/shell.rst 2009-08-23 05:27:40 UTC (rev 7536) @@ -66,7 +66,7 @@ ========================= If you can't use ipython, and still want to use matplotlib/pylab from -an interactive python shell, eg the plain-ol standard python +an interactive python shell, eg the plain-ole standard python interactive interpreter, or the interpreter in your favorite IDE, you are going to need to understand what a matplotlib backend is :ref:`what-is-a-backend`. Modified: branches/v0_99_maint/doc/users/transforms_tutorial.rst =================================================================== --- branches/v0_99_maint/doc/users/transforms_tutorial.rst 2009-08-23 05:18:45 UTC (rev 7535) +++ branches/v0_99_maint/doc/users/transforms_tutorial.rst 2009-08-23 05:27:40 UTC (rev 7536) @@ -225,7 +225,7 @@ :meth:`~matplotlib.axes.Axes.axvspan`) but for didactic purposes we will implement the horizontal span here using a blended transformation. This trick only works for separable transformations, -like you see in normal cartesian coordinate systems, but not on +like you see in normal Cartesian coordinate systems, but not on inseparable transformations like the :class:`~matplotlib.projections.polar.PolarAxes.PolarTransform`. @@ -301,7 +301,7 @@ shadow_transform = ax.transData + offset showing that can chain transformations using the addition operator. -This code says: first appy the data transformation ``ax.transData`` and +This code says: first apply the data transformation ``ax.transData`` and then translate the data by `dx` and `dy` points. .. plot:: @@ -352,7 +352,7 @@ in your axes which affects the affine transformation, but you may not need to compute the potentially expensive nonlinear scales or projections on simple navigation events. It is also possible to -multiply affine transformation matrices togeter, and then apply them +multiply affine transformation matrices together, and then apply them to coordinates in one step. This is not true of all possible transformations. @@ -404,7 +404,7 @@ The final piece is the ``self.transScale`` attribute, which is responsible for the optional non-linear scaling of the data, eg. for -logarithmic axes. When an Axes is initally setup, this is just set to +logarithmic axes. When an Axes is initially setup, this is just set to the identity transform, since the basic matplotlib axes has linear scale, but when you call a logarithmic scaling function like :meth:`~matplotlib.axes.Axes.semilogx` or explicitly set the scale to @@ -426,7 +426,7 @@ ``transProjection`` handles the projection from the space, eg. latitude and longitude for map data, or radius and theta for polar -data, to a separable cartesian coordinate system. There are several +data, to a separable Cartesian coordinate system. There are several projection examples in the ``matplotlib.projections`` package, and the best way to learn more is to open the source for those packages and see how to make your own, since matplotlib supports extensible axes Added: branches/v0_99_maint/examples/animation/animate_decay_tk_blit.py =================================================================== --- branches/v0_99_maint/examples/animation/animate_decay_tk_blit.py (rev 0) +++ branches/v0_99_maint/examples/animation/animate_decay_tk_blit.py 2009-08-23 05:27:40 UTC (rev 7536) @@ -0,0 +1,58 @@ +import time, sys +import numpy as np +import matplotlib.pyplot as plt + + +def data_gen(): + t = data_gen.t + data_gen.t += 0.05 + return np.sin(2*np.pi*t) * np.exp(-t/10.) +data_gen.t = 0 + +fig = plt.figure() +ax = fig.add_subplot(111) +line, = ax.plot([], [], animated=True, lw=2) +ax.set_ylim(-1.1, 1.1) +ax.set_xlim(0, 5) +ax.grid() +xdata, ydata = [], [] +def run(*args): + background = fig.canvas.copy_from_bbox(ax.bbox) + # for profiling + tstart = time.time() + + while 1: + # restore the clean slate background + fig.canvas.restore_region(background) + # update the data + t = data_gen.t + y = data_gen() + xdata.append(t) + ydata.append(y) + xmin, xmax = ax.get_xlim() + if t>=xmax: + ax.set_xlim(xmin, 2*xmax) + fig.canvas.draw() + background = fig.canvas.copy_from_bbox(ax.bbox) + + line.set_data(xdata, ydata) + + # just draw the animated artist + ax.draw_artist(line) + # just redraw the axes rectangle + fig.canvas.blit(ax.bbox) + + if run.cnt==1000: + # print the timing info and quit + print 'FPS:' , 1000/(time.time()-tstart) + sys.exit() + + run.cnt += 1 +run.cnt = 0 + + + +manager = plt.get_current_fig_manager() +manager.window.after(100, run) + +plt.show() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-30 03:40:21
|
Revision: 7589 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7589&view=rev Author: jdh2358 Date: 2009-08-30 03:40:08 +0000 (Sun, 30 Aug 2009) Log Message: ----------- added minor kwarg to get_?ticklines and applied ginpu patch Modified Paths: -------------- branches/v0_99_maint/doc/users/license.rst branches/v0_99_maint/lib/matplotlib/blocking_input.py branches/v0_99_maint/lib/matplotlib/figure.py Modified: branches/v0_99_maint/doc/users/license.rst =================================================================== --- branches/v0_99_maint/doc/users/license.rst 2009-08-30 01:04:11 UTC (rev 7588) +++ branches/v0_99_maint/doc/users/license.rst 2009-08-30 03:40:08 UTC (rev 7589) @@ -28,7 +28,7 @@ derivative works, distribute, and otherwise use matplotlib |version| alone or in any derivative version, provided, however, that JDH's License Agreement and JDH's notice of copyright, i.e., "Copyright (c) -2002-2008 John D. Hunter; All Rights Reserved" are retained in +2002-2009 John D. Hunter; All Rights Reserved" are retained in matplotlib |version| alone or in any derivative version prepared by Licensee. Modified: branches/v0_99_maint/lib/matplotlib/blocking_input.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/blocking_input.py 2009-08-30 01:04:11 UTC (rev 7588) +++ branches/v0_99_maint/lib/matplotlib/blocking_input.py 2009-08-30 03:40:08 UTC (rev 7589) @@ -114,15 +114,25 @@ Class that creates a callable object to retrieve mouse clicks in a blocking way. - This class will also retrieve keyboard clicks and treat them like + This class will also retrieve keyboard clicks and treat them like appropriate mouse clicks (delete and backspace are like mouse button 3, enter is like mouse button 2 and all others are like mouse button 1). """ - def __init__(self, fig): + + button_add = 1 + button_pop = 3 + button_stop = 2 + + def __init__(self, fig, mouse_add=1, mouse_pop=3, mouse_stop=2): BlockingInput.__init__(self, fig=fig, eventslist=('button_press_event', 'key_press_event') ) + self.button_add = mouse_add + self.button_pop = mouse_pop + self.button_stop= mouse_stop + + def post_event(self): """ This will be called to process events @@ -133,19 +143,19 @@ self.key_event() else: self.mouse_event() - + def mouse_event(self): '''Process a mouse click event''' event = self.events[-1] button = event.button - if button == 3: - self.button3(event) - elif button == 2: - self.button2(event) + if button == self.button_pop: + self.mouse_event_pop(event,-1) + elif button == self.button_stop: + self.mouse_event_stop(event) else: - self.button1(event) + self.mouse_event_add(event) def key_event(self): ''' @@ -154,16 +164,16 @@ ''' event = self.events[-1] - key = event.key + key = event.key.lower() - if key == 'backspace' or key == 'delete': - self.button3(event) - elif key == 'enter': - self.button2(event) + if key in ['backspace', 'delete']: + self.mouse_event_pop(event) + elif key in ['escape', 'enter']: # on windows XP and wxAgg, the enter key doesn't seem to register + self.mouse_event_stop(event) else: - self.button1(event) + self.mouse_event_add(event) - def button1( self, event ): + def mouse_event_add( self, event ): """ Will be called for any event involving a button other than button 2 or 3. This will add a click if it is inside axes. @@ -171,34 +181,34 @@ if event.inaxes: self.add_click(event) else: # If not a valid click, remove from event list - BlockingInput.pop(self) + BlockingInput.pop(self,-1) - def button2( self, event ): + def mouse_event_stop( self, event ): """ Will be called for any event involving button 2. Button 2 ends blocking input. """ # Remove last event just for cleanliness - BlockingInput.pop(self) + BlockingInput.pop(self,-1) # This will exit even if not in infinite mode. This is # consistent with matlab and sometimes quite useful, but will # require the user to test how many points were actually # returned before using data. - self.fig.canvas.stop_event_loop() + self.fig.canvas.stop_event_loop(event) - def button3( self, event ): + def mouse_event_pop( self, event ): """ Will be called for any event involving button 3. Button 3 removes the last click. """ # Remove this last event - BlockingInput.pop(self) + BlockingInput.pop(self,-1) # Now remove any existing clicks if possible if len(self.events)>0: - self.pop() + self.pop(event,-1) def add_click(self,event): """ @@ -211,11 +221,23 @@ # If desired plot up click if self.show_clicks: + + # make sure we don't mess with the axes zoom + xlim = event.inaxes.get_xlim() + ylim = event.inaxes.get_ylim() + + # plot the clicks self.marks.extend( event.inaxes.plot([event.xdata,], [event.ydata,], 'r+') ) + + # before we draw, make sure to reset the limits + event.inaxes.set_xlim(xlim) + event.inaxes.set_ylim(ylim) self.fig.canvas.draw() - def pop_click(self,index=-1): + + + def pop_click(self,event,index=-1): """ This removes a click from the list of clicks. Defaults to removing the last click. @@ -223,25 +245,49 @@ self.clicks.pop(index) if self.show_clicks: + + # make sure we don't mess with the axes zoom + xlim = event.inaxes.get_xlim() + ylim = event.inaxes.get_ylim() + mark = self.marks.pop(index) mark.remove() + + # before we draw, make sure to reset the limits + event.inaxes.set_xlim(xlim) + event.inaxes.set_ylim(ylim) self.fig.canvas.draw() + # NOTE: I do NOT understand why the above 3 lines does not work + # for the keyboard backspace event on windows XP wxAgg. + # maybe event.inaxes here is a COPY of the actual axes? - def pop(self,index=-1): + + def pop(self,event,index=-1): """ This removes a click and the associated event from the object. Defaults to removing the last click, but any index can be supplied. """ - self.pop_click(index) + self.pop_click(event,index) BlockingInput.pop(self,index) - def cleanup(self): + def cleanup(self,event=None): # clean the figure if self.show_clicks: + if event: + # make sure we don't mess with the axes zoom + xlim = event.inaxes.get_xlim() + ylim = event.inaxes.get_ylim() + for mark in self.marks: mark.remove() self.marks = [] + + if event: + # before we draw, make sure to reset the limits + event.inaxes.set_xlim(xlim) + event.inaxes.set_ylim(ylim) + self.fig.canvas.draw() # Call base class to remove callbacks Modified: branches/v0_99_maint/lib/matplotlib/figure.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/figure.py 2009-08-30 01:04:11 UTC (rev 7588) +++ branches/v0_99_maint/lib/matplotlib/figure.py 2009-08-30 03:40:08 UTC (rev 7589) @@ -1086,11 +1086,12 @@ ax.update_params() ax.set_position(ax.figbox) - def ginput(self, n=1, timeout=30, show_clicks=True): + def ginput(self, n=1, timeout=30, show_clicks=True, mouse_add=1, mouse_pop=3, mouse_stop=2): """ call signature:: - ginput(self, n=1, timeout=30, show_clicks=True) + ginput(self, n=1, timeout=30, show_clicks=True, + mouse_add=1, mouse_pop=3, mouse_stop=2) Blocking call to interact with the figure. @@ -1111,7 +1112,9 @@ manager) selects a point. """ - blocking_mouse_input = BlockingMouseInput(self) + blocking_mouse_input = BlockingMouseInput(self, mouse_add =mouse_add, + mouse_pop =mouse_pop, + mouse_stop=mouse_stop) return blocking_mouse_input(n=n, timeout=timeout, show_clicks=show_clicks) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-08-30 16:22:47
|
Revision: 7600 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7600&view=rev Author: jdh2358 Date: 2009-08-30 16:22:38 +0000 (Sun, 30 Aug 2009) Log Message: ----------- some unit cleanup; fix sf bug 2846058 Modified Paths: -------------- branches/v0_99_maint/examples/units/annotate_with_units.py branches/v0_99_maint/examples/units/bar_demo2.py branches/v0_99_maint/examples/units/radian_demo.py branches/v0_99_maint/lib/matplotlib/axes.py branches/v0_99_maint/lib/matplotlib/collections.py Modified: branches/v0_99_maint/examples/units/annotate_with_units.py =================================================================== --- branches/v0_99_maint/examples/units/annotate_with_units.py 2009-08-30 15:43:39 UTC (rev 7599) +++ branches/v0_99_maint/examples/units/annotate_with_units.py 2009-08-30 16:22:38 UTC (rev 7600) @@ -1,8 +1,7 @@ - -import pylab +import matplotlib.pyplot as plt from basic_units import cm -fig = pylab.figure() +fig = plt.figure() ax = fig.add_subplot(111) @@ -23,5 +22,5 @@ ax.set_xlim(0*cm, 4*cm) ax.set_ylim(0*cm, 4*cm) -pylab.show() +plt.show() Modified: branches/v0_99_maint/examples/units/bar_demo2.py =================================================================== --- branches/v0_99_maint/examples/units/bar_demo2.py 2009-08-30 15:43:39 UTC (rev 7599) +++ branches/v0_99_maint/examples/units/bar_demo2.py 2009-08-30 16:22:38 UTC (rev 7600) @@ -25,11 +25,11 @@ ax3 = fig.add_subplot(2,2,3) ax3.bar(cms, cms, bottom=bottom, width=width, xunits=inch, yunits=cm) -ax3.set_xlim(3, 6) # scalars are interpreted in current units +ax3.set_xlim(2, 6) # scalars are interpreted in current units ax4 = fig.add_subplot(2,2,4) ax4.bar(cms, cms, bottom=bottom, width=width, xunits=inch, yunits=inch) #fig.savefig('simple_conversion_plot.png') -ax4.set_xlim(3*cm, 6*cm) # cm are converted to inches +ax4.set_xlim(2*cm, 6*cm) # cm are converted to inches show() Modified: branches/v0_99_maint/examples/units/radian_demo.py =================================================================== --- branches/v0_99_maint/examples/units/radian_demo.py 2009-08-30 15:43:39 UTC (rev 7599) +++ branches/v0_99_maint/examples/units/radian_demo.py 2009-08-30 16:22:38 UTC (rev 7600) @@ -7,15 +7,15 @@ from basic_units import radians, degrees, cos from matplotlib.pyplot import figure, show -x = np.arange(0, 15, 0.01) * radians +x = [val*radians for val in np.arange(0, 15, 0.01)] fig = figure() fig.subplots_adjust(hspace=0.3) ax = fig.add_subplot(211) -ax.plot(x, cos(x), xunits=radians) +line1, = ax.plot(x, cos(x), xunits=radians) ax = fig.add_subplot(212) -ax.plot(x, cos(x), xunits=degrees) +line2, = ax.plot(x, cos(x), xunits=degrees) show() Modified: branches/v0_99_maint/lib/matplotlib/axes.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/axes.py 2009-08-30 15:43:39 UTC (rev 7599) +++ branches/v0_99_maint/lib/matplotlib/axes.py 2009-08-30 16:22:38 UTC (rev 7600) @@ -203,11 +203,25 @@ if self.axes.xaxis is not None and self.axes.yaxis is not None: bx = self.axes.xaxis.update_units(x) by = self.axes.yaxis.update_units(y) - if bx: - x = self.axes.convert_xunits(x) - if by: - y = self.axes.convert_yunits(y) + if self.command!='plot': + # the Line2D class can handle unitized data, with + # support for post hoc unit changes etc. Other mpl + # artists, eg Polygon which _process_plot_var_args + # also serves on calls to fill, cannot. So this is a + # hack to say: if you are not "plot", which is + # creating Line2D, then convert the data now to + # floats. If you are plot, pass the raw data through + # to Line2D which will handle the conversion. So + # polygons will not support post hoc conversions of + # the unit type since they are not storing the orig + # data. Hopefully we can rationalize this at a later + # date - JDH + if bx: + x = self.axes.convert_xunits(x) + if by: + y = self.axes.convert_yunits(y) + x = np.atleast_1d(x) #like asanyarray, but converts scalar to array y = np.atleast_1d(y) if x.shape[0] != y.shape[0]: @@ -4255,10 +4269,14 @@ if self.xaxis is not None: left = self.convert_xunits( left ) width = self.convert_xunits( width ) + if xerr is not None: + xerr = self.convert_xunits( xerr ) if self.yaxis is not None: bottom = self.convert_yunits( bottom ) height = self.convert_yunits( height ) + if yerr is not None: + yerr = self.convert_yunits( yerr ) if align == 'edge': pass Modified: branches/v0_99_maint/lib/matplotlib/collections.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/collections.py 2009-08-30 15:43:39 UTC (rev 7599) +++ branches/v0_99_maint/lib/matplotlib/collections.py 2009-08-30 16:22:38 UTC (rev 7600) @@ -931,7 +931,9 @@ def set_segments(self, segments): if segments is None: return _segments = [] + for seg in segments: + if not np.ma.isMaskedArray(seg): seg = np.asarray(seg, np.float_) _segments.append(seg) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2009-09-09 19:56:02
|
Revision: 7728 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7728&view=rev Author: mdboom Date: 2009-09-09 19:55:52 +0000 (Wed, 09 Sep 2009) Log Message: ----------- Fix some documentation warnings. Modified Paths: -------------- branches/v0_99_maint/doc/api/spine_api.rst branches/v0_99_maint/doc/mpl_toolkits/mplot3d/tutorial.rst branches/v0_99_maint/doc/users/image_tutorial.rst branches/v0_99_maint/doc/users/index.rst branches/v0_99_maint/doc/users/pyplot_tutorial.rst branches/v0_99_maint/lib/matplotlib/axes.py branches/v0_99_maint/lib/matplotlib/mlab.py Modified: branches/v0_99_maint/doc/api/spine_api.rst =================================================================== --- branches/v0_99_maint/doc/api/spine_api.rst 2009-09-09 18:41:43 UTC (rev 7727) +++ branches/v0_99_maint/doc/api/spine_api.rst 2009-09-09 19:55:52 UTC (rev 7728) @@ -6,7 +6,7 @@ :mod:`matplotlib.spine` ======================== -.. automodule:: matplotlib.spine +.. automodule:: matplotlib.spines :members: :undoc-members: :show-inheritance: Modified: branches/v0_99_maint/doc/mpl_toolkits/mplot3d/tutorial.rst =================================================================== --- branches/v0_99_maint/doc/mpl_toolkits/mplot3d/tutorial.rst 2009-09-09 18:41:43 UTC (rev 7727) +++ branches/v0_99_maint/doc/mpl_toolkits/mplot3d/tutorial.rst 2009-09-09 19:55:52 UTC (rev 7728) @@ -55,7 +55,7 @@ Polygon plots ==================== -.. automethod:: add_collection3d +.. automethod:: Axes3D.add_collection3d .. plot:: mpl_examples/mplot3d/polys3d_demo.py Modified: branches/v0_99_maint/doc/users/image_tutorial.rst =================================================================== --- branches/v0_99_maint/doc/users/image_tutorial.rst 2009-09-09 18:41:43 UTC (rev 7727) +++ branches/v0_99_maint/doc/users/image_tutorial.rst 2009-09-09 19:55:52 UTC (rev 7728) @@ -10,17 +10,20 @@ Startup commands =================== -At the very least, you'll need to have access to the :func:`~matplotlib.pyplot.imshow` function. There are a couple of ways to do it. The easy way for an interactive environment:: +At the very least, you'll need to have access to the +:func:`~matplotlib.pyplot.imshow` function. There are a couple of +ways to do it. The easy way for an interactive environment:: - $ipython -pylab - + $ipython -pylab + The imshow function is now directly accessible (it's in your `namespace <http://bytebaker.com/2008/07/30/python-namespaces/>`_). See also :ref:`pyplot-tutorial`. The more expressive, easier to understand later method (use this in your scripts to make it easier for others (including your future self) -to read) is to use the matplotlib API (see :ref:`artist-tutorial`) where you use explicit namespaces and control object creation, etc... +to read) is to use the matplotlib API (see :ref:`artist-tutorial`) +where you use explicit namespaces and control object creation, etc... .. sourcecode:: ipython @@ -28,16 +31,22 @@ In [2]: import matplotlib.image as mpimg In [3]: import numpy as np -Examples below will use the latter method, for clarity. In these examples, if you use the -pylab method, you can skip the "mpimg." and "plt." prefixes. +Examples below will use the latter method, for clarity. In these +examples, if you use the -pylab method, you can skip the "mpimg." and +"plt." prefixes. .. _importing_data: Importing image data into Numpy arrays =============================================== -Plotting image data is supported by the Python Image Library (`PIL <http://www.pythonware.com/products/pil/>`_), . Natively, matplotlib only supports PNG images. The commands shown below fall back on PIL if the native read fails. +Plotting image data is supported by the Python Image Library (`PIL +<http://www.pythonware.com/products/pil/>`_), . Natively, matplotlib +only supports PNG images. The commands shown below fall back on PIL +if the native read fails. -The image used in this example is a PNG file, but keep that PIL requirement in mind for your own data. +The image used in this example is a PNG file, but keep that PIL +requirement in mind for your own data. Here's the image we're going to play with: @@ -55,11 +64,11 @@ .. sourcecode:: ipython In [4]: img=mpimg.imread('stinkbug.png') - Out[4]: + Out[4]: array([[[ 0.40784314, 0.40784314, 0.40784314], [ 0.40784314, 0.40784314, 0.40784314], [ 0.40784314, 0.40784314, 0.40784314], - ..., + ..., [ 0.42745098, 0.42745098, 0.42745098], [ 0.42745098, 0.42745098, 0.42745098], [ 0.42745098, 0.42745098, 0.42745098]], @@ -67,7 +76,7 @@ [[ 0.41176471, 0.41176471, 0.41176471], [ 0.41176471, 0.41176471, 0.41176471], [ 0.41176471, 0.41176471, 0.41176471], - ..., + ..., [ 0.42745098, 0.42745098, 0.42745098], [ 0.42745098, 0.42745098, 0.42745098], [ 0.42745098, 0.42745098, 0.42745098]], @@ -75,16 +84,16 @@ [[ 0.41960785, 0.41960785, 0.41960785], [ 0.41568628, 0.41568628, 0.41568628], [ 0.41568628, 0.41568628, 0.41568628], - ..., + ..., [ 0.43137255, 0.43137255, 0.43137255], [ 0.43137255, 0.43137255, 0.43137255], [ 0.43137255, 0.43137255, 0.43137255]], - ..., + ..., [[ 0.43921569, 0.43921569, 0.43921569], [ 0.43529412, 0.43529412, 0.43529412], [ 0.43137255, 0.43137255, 0.43137255], - ..., + ..., [ 0.45490196, 0.45490196, 0.45490196], [ 0.4509804 , 0.4509804 , 0.4509804 ], [ 0.4509804 , 0.4509804 , 0.4509804 ]], @@ -92,7 +101,7 @@ [[ 0.44313726, 0.44313726, 0.44313726], [ 0.44313726, 0.44313726, 0.44313726], [ 0.43921569, 0.43921569, 0.43921569], - ..., + ..., [ 0.4509804 , 0.4509804 , 0.4509804 ], [ 0.44705883, 0.44705883, 0.44705883], [ 0.44705883, 0.44705883, 0.44705883]], @@ -100,26 +109,46 @@ [[ 0.44313726, 0.44313726, 0.44313726], [ 0.4509804 , 0.4509804 , 0.4509804 ], [ 0.4509804 , 0.4509804 , 0.4509804 ], - ..., + ..., [ 0.44705883, 0.44705883, 0.44705883], [ 0.44705883, 0.44705883, 0.44705883], [ 0.44313726, 0.44313726, 0.44313726]]], dtype=float32) -Note the dtype there - float32. Matplotlib has rescaled the 8 bit data from each channel to floating point data between 0.0 and 1.0. As a side note, the only datatype that PIL can work with is uint8. Matplotlib plotting can handle float32 and uint8, but image reading/writing for any format other than PNG is limited to uint8 data. Why 8 bits? Most displays can only render 8 bits per channel worth of color gradation. Why can they only render 8 bits/channel? Because that's about all the human eye can see. More here (from a photography standpoint): `Luminous Landscape bit depth tutorial <http://www.luminous-landscape.com/tutorials/bit-depth.shtml>`_ +Note the dtype there - float32. Matplotlib has rescaled the 8 bit +data from each channel to floating point data between 0.0 and 1.0. As +a side note, the only datatype that PIL can work with is uint8. +Matplotlib plotting can handle float32 and uint8, but image +reading/writing for any format other than PNG is limited to uint8 +data. Why 8 bits? Most displays can only render 8 bits per channel +worth of color gradation. Why can they only render 8 bits/channel? +Because that's about all the human eye can see. More here (from a +photography standpoint): `Luminous Landscape bit depth tutorial +<http://www.luminous-landscape.com/tutorials/bit-depth.shtml>`_. -Each inner list represents a pixel. Here, with an RGB image, there are 3 values. Since it's a black and white image, R, G, and B are all similar. An RGBA (where A is alpha, or transparency), has 4 values per inner list, and a simple luminance image just has one value (and is thus only a 2-D array, not a 3-D array). For RGB and RGBA images, matplotlib supports float32 and uint8 data types. For grayscale, matplotlib supports only float32. If your array data does not meet one of these descriptions, you need to rescale it. +Each inner list represents a pixel. Here, with an RGB image, there +are 3 values. Since it's a black and white image, R, G, and B are all +similar. An RGBA (where A is alpha, or transparency), has 4 values +per inner list, and a simple luminance image just has one value (and +is thus only a 2-D array, not a 3-D array). For RGB and RGBA images, +matplotlib supports float32 and uint8 data types. For grayscale, +matplotlib supports only float32. If your array data does not meet +one of these descriptions, you need to rescale it. .. _plotting_data: Plotting numpy arrays as images =================================== -So, you have your data in a numpy array (either by importing it, or by generating it). Let's render it. In Matplotlib, this is performed using the :func:`~matplotlib.pyplot.imshow` function. Here we'll grab the plot object. This object gives you an easy way to manipulate the plot from the prompt. +So, you have your data in a numpy array (either by importing it, or by +generating it). Let's render it. In Matplotlib, this is performed +using the :func:`~matplotlib.pyplot.imshow` function. Here we'll grab +the plot object. This object gives you an easy way to manipulate the +plot from the prompt. .. sourcecode:: ipython In [5]: imgplot = plt.imshow(img) - + .. plot:: import matplotlib.pyplot as plt @@ -128,23 +157,31 @@ img = mpimg.imread('_static/stinkbug.png') imgplot = plt.imshow(img) -You can also plot any numpy array - just remember that the datatype must be float32 (and range from 0.0 to 1.0) or uint8. +You can also plot any numpy array - just remember that the datatype +must be float32 (and range from 0.0 to 1.0) or uint8. .. _Pseudocolor: - + Applying pseudocolor schemes to image plots ------------------------------------------------- -Pseudocolor can be a useful tool for enhancing contrast and visualizing your data more easily. This is especially useful when making presentations of your data using projectors - their contrast is typically quite poor. +Pseudocolor can be a useful tool for enhancing contrast and +visualizing your data more easily. This is especially useful when +making presentations of your data using projectors - their contrast is +typically quite poor. -Pseudocolor is only relevant to single-channel, grayscale, luminosity images. We currently have an RGB image. Since R, G, and B are all similar (see for yourself above or in your data), we can just pick on channel of our data: +Pseudocolor is only relevant to single-channel, grayscale, luminosity +images. We currently have an RGB image. Since R, G, and B are all +similar (see for yourself above or in your data), we can just pick on +channel of our data: .. sourcecode:: ipython In [6]: lum_img = img[:,:,0] - -This is array slicing. You can read more `here <http://www.scipy.org/Tentative_NumPy_Tutorial>`_ - + +This is array slicing. You can read more `here +<http://www.scipy.org/Tentative_NumPy_Tutorial>`_. + .. sourcecode:: ipython In [7]: imgplot = mpimg.imshow(lum_img) @@ -158,7 +195,11 @@ lum_img = img[:,:,0] plt.imshow(lum_img) -Now, with a luminosity image, the default colormap (aka lookup table, LUT), is applied. The default is called jet. There are plenty of others to choose from. Let's set some others using the :meth:`~matplotlib.image.Image.set_cmap` method on our image plot object: +Now, with a luminosity image, the default colormap (aka lookup table, +LUT), is applied. The default is called jet. There are plenty of +others to choose from. Let's set some others using the +:meth:`~matplotlib.image.Image.set_cmap` method on our image plot +object: .. sourcecode:: ipython @@ -173,11 +214,11 @@ lum_img = img[:,:,0] imgplot = plt.imshow(lum_img) imgplot.set_cmap('hot') - + .. sourcecode:: ipython In [9]: imgplot.set_cmap('spectral') - + .. plot:: import matplotlib.pyplot as plt @@ -188,18 +229,22 @@ imgplot = plt.imshow(lum_img) imgplot.set_cmap('spectral') -There are many other colormap schemes available. See a list and images of the colormaps `here <http://matplotlib.sourceforge.net/examples/pylab_examples/show_colormaps.html>`_ - +There are many other colormap schemes available. See a list and +images of the colormaps `here +<http://matplotlib.sourceforge.net/examples/pylab_examples/show_colormaps.html>`_. + .. _Color Bars Color scale reference ------------------------ -It's helpful to have an idea of what value a color represents. We can do that by adding color bars. It's as easy as one line: +It's helpful to have an idea of what value a color represents. We can +do that by adding color bars. It's as easy as one line: .. sourcecode:: ipython + In [10]: plt.colorbar() - + .. plot:: import matplotlib.pyplot as plt @@ -210,15 +255,22 @@ imgplot = plt.imshow(lum_img) imgplot.set_cmap('spectral') plt.colorbar() - -This adds a colorbar to your existing figure. This won't automatically change if you change you switch to a different colormap - you have to re-create your plot, and add in the colorbar again. +This adds a colorbar to your existing figure. This won't +automatically change if you change you switch to a different +colormap - you have to re-create your plot, and add in the colorbar +again. + .. _Data ranges Examining a specific data range --------------------------------- -Sometimes you want to enhance the contrast in your image, or expand the contrast in a particular region while sacrificing the detail in colors that don't vary much, or don't matter. A good tool to find interesting regions is the histogram. To create a histogram of our image data, we use the :func:`~matplotlib.pyplot.hist` function. +Sometimes you want to enhance the contrast in your image, or expand +the contrast in a particular region while sacrificing the detail in +colors that don't vary much, or don't matter. A good tool to find +interesting regions is the histogram. To create a histogram of our +image data, we use the :func:`~matplotlib.pyplot.hist` function. .. sourcecode:: ipython @@ -233,7 +285,14 @@ lum_img = img[:,:,0] plt.hist(lum_img, range=(0.0,1.0)) -Most often, the "interesting" part of the image is around the peak, and you can get extra contrast by clipping the regions above and/or below the peak. In our histogram, it looks like there's not much useful information in the high end (not many white things in the image). Let's adjust the upper limit, so that we effectively "zoom in on" part of the histogram. We do this by calling the :meth:`~matplotlib.image.Image.set_clim` method of the image plot object. +Most often, the "interesting" part of the image is around the peak, +and you can get extra contrast by clipping the regions above and/or +below the peak. In our histogram, it looks like there's not much +useful information in the high end (not many white things in the +image). Let's adjust the upper limit, so that we effectively "zoom in +on" part of the histogram. We do this by calling the +:meth:`~matplotlib.image.Image.set_clim` method of the image plot +object. .. sourcecode:: ipython @@ -249,8 +308,8 @@ img = mpimg.imread('_static/stinkbug.png') lum_img = img[:,:,0] imgplot = plt.imshow(lum_img) - a.set_title('Before') - plt.colorbar(ticks=[0.1,0.3,0.5,0.7], orientation ='horizontal') + a.set_title('Before') + plt.colorbar(ticks=[0.1,0.3,0.5,0.7], orientation ='horizontal') a=fig.add_subplot(1,2,2) imgplot = plt.imshow(lum_img) imgplot.set_clim(0.0,0.7) @@ -260,9 +319,21 @@ .. _Interpolation: Array Interpolation schemes ------------------------------------ -Interpolation calculates what the color or value of a pixel "should" be, according to different mathematical schemes. One common place that this happens is when you resize an image. The number of pixels change, but you want the same information. Since pixels are discrete, there's missing space. Interpolation is how you fill that space. This is why your images sometimes come out looking pixelated when you blow them up. The effect is more pronounced when the difference between the original image and the expanded image is greater. Let's take our image and shrink it. We're effectively discarding pixels, only keeping a select few. Now when we plot it, that data gets blown up to the size on your screen. The old pixels aren't there anymore, and the computer has to draw in pixels to fill that space. +--------------------------- +Interpolation calculates what the color or value of a pixel "should" +be, according to different mathematical schemes. One common place +that this happens is when you resize an image. The number of pixels +change, but you want the same information. Since pixels are discrete, +there's missing space. Interpolation is how you fill that space. +This is why your images sometimes come out looking pixelated when you +blow them up. The effect is more pronounced when the difference +between the original image and the expanded image is greater. Let's +take our image and shrink it. We're effectively discarding pixels, +only keeping a select few. Now when we plot it, that data gets blown +up to the size on your screen. The old pixels aren't there anymore, +and the computer has to draw in pixels to fill that space. + .. sourcecode:: ipython In [8]: import Image @@ -272,7 +343,7 @@ In [12]: imgplot = mpimg.imshow(rsizeArr) .. plot:: - + import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np @@ -283,7 +354,8 @@ lum_img = rsizeArr[:,:,0] imgplot = plt.imshow(rsizeArr) -Here we have the default interpolation, bilinear, since we did not give :func:`~matplotlib.pyplot.imshow` any interpolation argument. +Here we have the default interpolation, bilinear, since we did not +give :func:`~matplotlib.pyplot.imshow` any interpolation argument. Let's try some others: @@ -302,10 +374,10 @@ rsizeArr = np.asarray(rsize) lum_img = rsizeArr[:,:,0] imgplot = plt.imshow(rsizeArr) - imgplot.set_interpolation('nearest') - + imgplot.set_interpolation('nearest') + .. sourcecode:: ipython - + In [10]: imgplot.set_interpolation('bicubic') .. plot:: @@ -320,5 +392,6 @@ lum_img = rsizeArr[:,:,0] imgplot = plt.imshow(rsizeArr) imgplot.set_interpolation('bicubic') - -Bicubic interpolation is often used when blowing up photos - people tend to prefer blurry over pixelated. \ No newline at end of file + +Bicubic interpolation is often used when blowing up photos - people +tend to prefer blurry over pixelated. Modified: branches/v0_99_maint/doc/users/index.rst =================================================================== --- branches/v0_99_maint/doc/users/index.rst 2009-09-09 18:41:43 UTC (rev 7727) +++ branches/v0_99_maint/doc/users/index.rst 2009-09-09 19:55:52 UTC (rev 7728) @@ -23,7 +23,6 @@ artists.rst legend_guide.rst event_handling.rst - legend.rst transforms_tutorial.rst path_tutorial.rst annotations_guide.rst Modified: branches/v0_99_maint/doc/users/pyplot_tutorial.rst =================================================================== --- branches/v0_99_maint/doc/users/pyplot_tutorial.rst 2009-09-09 18:41:43 UTC (rev 7727) +++ branches/v0_99_maint/doc/users/pyplot_tutorial.rst 2009-09-09 19:55:52 UTC (rev 7728) @@ -165,17 +165,17 @@ ``figure(1)`` will be created by default, just as a ``subplot(111)`` will be created by default if you don't manually specify an axes. The :func:`~matplotlib.pyplot.subplot` command specifies ``numrows, - numcols, fignum`` where ``fignum`` ranges from 1 to -``numrows*numcols``. The commas in the ``subplot`` command are optional -if ``numrows*numcols<10``. So ``subplot(211)`` is identical to -``subplot(2,1,1)``. You can create an arbitrary number of subplots +numcols, fignum`` where ``fignum`` ranges from 1 to +``numrows*numcols``. The commas in the ``subplot`` command are +optional if ``numrows*numcols<10``. So ``subplot(211)`` is identical +to ``subplot(2,1,1)``. You can create an arbitrary number of subplots and axes. If you want to place an axes manually, ie, not on a rectangular grid, use the :func:`~matplotlib.pyplot.axes` command, which allows you to specify the location as ``axes([left, bottom, width, height])`` where all values are in fractional (0 to 1) coordinates. See :ref:`pylab_examples-axes_demo` for an example of -placing axes manually and :ref:`pylab_examples-line_styles` for an example -with lots-o-subplots. +placing axes manually and :ref:`pylab_examples-line_styles` for an +example with lots-o-subplots. You can create multiple figures by using multiple @@ -267,6 +267,6 @@ In this basic example, both the ``xy`` (arrow tip) and ``xytext`` locations (text location) are in data coordinates. There are a variety of other coordinate systems one can choose -- see -:ref:`annotations-tutorial` and :ref:`plotting-guide-annotation` -for details. More examples can be found -in :ref:`pylab_examples-annotation_demo`. +:ref:`annotations-tutorial` and :ref:`plotting-guide-annotation` for +details. More examples can be found in +:ref:`pylab_examples-annotation_demo`. Modified: branches/v0_99_maint/lib/matplotlib/axes.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/axes.py 2009-09-09 18:41:43 UTC (rev 7727) +++ branches/v0_99_maint/lib/matplotlib/axes.py 2009-09-09 19:55:52 UTC (rev 7728) @@ -1338,7 +1338,7 @@ def add_artist(self, a): ''' - Add any :class:`~matplotlib.artist.Artist` to the axes + Add any :class:`~matplotlib.artist.Artist` to the axes. Returns the artist. ''' @@ -1351,8 +1351,8 @@ def add_collection(self, collection, autolim=True): ''' - add a :class:`~matplotlib.collections.Collection` instance - to the axes + Add a :class:`~matplotlib.collections.Collection` instance + to the axes. Returns the collection. ''' @@ -3710,15 +3710,15 @@ *maxlags* is a positive integer detailing the number of lags to show. The default value of *None* will return all - :math:`2 \mathrm{len}(x) - 1` lags. + :math:`2 \times \mathrm{len}(x) - 1` lags. The return value is a tuple (*lags*, *c*, *linecol*, *b*) where - - *linecol* is the - :class:`~matplotlib.collections.LineCollection` + - *linecol* is the + :class:`~matplotlib.collections.LineCollection` - - *b* is the *x*-axis. + - *b* is the *x*-axis. .. seealso:: Modified: branches/v0_99_maint/lib/matplotlib/mlab.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/mlab.py 2009-09-09 18:41:43 UTC (rev 7727) +++ branches/v0_99_maint/lib/matplotlib/mlab.py 2009-09-09 19:55:52 UTC (rev 7728) @@ -569,7 +569,7 @@ example script that shows that this :func:`cohere_pairs` and :func:`cohere` give the same results for a given pair. - .. sealso:: + .. seealso:: :func:`psd` For information about the methods used to compute This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-09-12 21:11:53
|
Revision: 7751 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7751&view=rev Author: jdh2358 Date: 2009-09-12 21:11:42 +0000 (Sat, 12 Sep 2009) Log Message: ----------- tagging for 99.1 release candiate Modified Paths: -------------- branches/v0_99_maint/README.txt branches/v0_99_maint/lib/matplotlib/__init__.py branches/v0_99_maint/make.osx Modified: branches/v0_99_maint/README.txt =================================================================== --- branches/v0_99_maint/README.txt 2009-09-11 21:22:52 UTC (rev 7750) +++ branches/v0_99_maint/README.txt 2009-09-12 21:11:42 UTC (rev 7751) @@ -1,61 +1,45 @@ -Overview of the matplotlib src tree -=================================== +matplotlib for MacOS X 10.3.9 or later and Python 2.5 and Python 2.6 -This is the source directory for matplotlib, which contains the -following files and directories. +matplotlib is a python 2D plotting library which produces publication +quality figures in a variety of hardcopy formats and interactive +environments across platforms. matplotlib can be used in python +scripts, the python and ipython shell (ala matlab or mathematica), web +application servers, and various graphical user interface toolkits. -* doc - the matplotlib documentation. See doc/users for the user's - documentation and doc/devel for the developers documentation +Home page: <http://matplotlib.sourceforge.net/> -* examples - a bunch of examples using matplotib. See - examples/README.txt for information +Before running matplotlib, you must install numpy. Binary installers +for all these packages are available here: -* setup.cfg.template - used to configure the matplotlib build process. - Copy this file to setup.cfg if you want to override the default - build behavior + <http://pythonmac.org/packages/py25-fat/index.html>. -* matplotlibrc.template - a template file used to generate the - matplotlibrc config file at build time. The matplotlibrc file will - be installed in matplotlib/mpl-data/matplotlibrc +*** Back Ends *** -* lib - the python src code. matplotlib ships several third party - packages here. The subdirectory lib/matplotlib contains the python - src code for matplotlib +You may use TkAgg or WXAgg back ends; Qt and GTK support is not +provided in this package. By default this matplotlib uses TkAgg +because Tcl/Tk is included with MacOS X. -* src - the matplotlib extension code, mostly C++ +If you wish to use WXAgg then: +* Install wxPython from: + <http://pythonmac.org/packages/py25-fat/index.html>. +* Configure a matplotlibrc file, as described below. -* ttconv - some truetype font utilities +For TkAgg you may use Apple's built-in Tcl/Tk or install your own 8.4.x -* license - all the licenses for code included with matplotlib. - matplotlib uses only BSD compatible code +*** Configuring a matplotlibrc file *** -* unit - some unit tests +If you wish to change any matplotlib settings, create a file: + ~/.matplotlib/matplotlibrc -* CHANGELOG - all the significant changes to matplotlib, organized by - release. The top of this file will show you the most recent changes -* API_CHANGES - any change that alters the API is listed here. The - entries are organized by release, with most recent entries first +that contains at least the following information. The values shown are +the defaults in the internal matplotlibrc file; change them as you see +fit: -* MIGRATION.txt - instructions on moving from the 0.91 code to the - 0.98 trunk. +# the default backend; one of GTK GTKAgg GTKCairo FltkAgg QtAgg TkAgg WXAgg +# Agg Cairo GD GDK Paint PS PDF SVG Template +backend : TkAgg +interactive : False # see http://matplotlib.sourceforge.net/interactive.html -* SEGFAULTS - some tips for how to diagnose and debug segfaults - -* setup.py - the matplotlib build script - -* setupext.py - some helper code for setup.py to build the matplotlib - extensions - -* boilerplate.py - some code to automatically generate the pyplot - wrappers - -* DEVNOTES - deprecated developer notes. TODO: update and move to the - doc/devel framework - -* FILETYPES - This is a table of the output formats supported by each - backend. TODO: move to doc/users - -* INTERACTIVE - instructions on using matplotlib interactively, eg - from the python shell. TODO: update and move to doc/users. - +See also +<http://matplotlib.sourceforge.net/users/customizing.html> Modified: branches/v0_99_maint/lib/matplotlib/__init__.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/__init__.py 2009-09-11 21:22:52 UTC (rev 7750) +++ branches/v0_99_maint/lib/matplotlib/__init__.py 2009-09-12 21:11:42 UTC (rev 7751) @@ -89,7 +89,7 @@ """ from __future__ import generators -__version__ = '0.99.0' +__version__ = '0.99.1rc1' __revision__ = '$Revision$' __date__ = '$Date$' Modified: branches/v0_99_maint/make.osx =================================================================== --- branches/v0_99_maint/make.osx 2009-09-11 21:22:52 UTC (rev 7750) +++ branches/v0_99_maint/make.osx 2009-09-12 21:11:42 UTC (rev 7751) @@ -1,6 +1,7 @@ # build mpl into a local install dir with # PREFIX=/Users/jdhunter/dev make -f make.osx fetch deps mpl_install +MPLVERSION=0.99.1rc1 PYVERSION=2.6 PYTHON=python${PYVERSION} ZLIBVERSION=1.2.3 @@ -10,13 +11,10 @@ ## You shouldn't need to configure past this point -CFLAGS="-Os -arch ppc -arch i386 -I{$PREFIX}/include" -LDFLAGS="-arch ppc -arch i386 -L${PREFIX}/lib" +CFLAGS="-arch i386 -arch ppc -I${PREFIX}/include -I${PREFIX}/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" +LDFLAGS="-arch i386 -arch ppc -L${PREFIX}/lib -syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" -CFLAGS_DEPS="-arch i386 -arch ppc -I${PREFIX}/include -I${PREFIX}/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" -LDFLAGS_DEPS="-arch i386 -arch ppc -L${PREFIX}/lib -syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" - clean: rm -rf zlib-${ZLIBVERSION}.tar.gz libpng-${PNGVERSION}.tar.bz2 \ freetype-${FREETYPEVERSION}.tar.bz2 bdist_mpkg-${BDISTMPKGVERSION}.tar.gz \ @@ -37,10 +35,10 @@ tar xvfz zlib-${ZLIBVERSION}.tar.gz &&\ cd zlib-${ZLIBVERSION} &&\ export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\ - export CFLAGS=${CFLAGS_DEPS} &&\ - export LDFLAGS=${LDFLAGS_DEPS} &&\ + export CFLAGS=${CFLAGS} &&\ + export LDFLAGS=${LDFLAGS} &&\ ./configure --prefix=${PREFIX}&&\ - MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} CFLAGS=${CFLAGS_DEPS} LDFLAGS=${LDFLAGS_DEPS} make -j3 install&& \ + MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} make -j3 install&& \ unset MACOSX_DEPLOYMENT_TARGET png: zlib @@ -49,8 +47,8 @@ tar xvfj libpng-${PNGVERSION}.tar.bz2 cd libpng-${PNGVERSION} &&\ export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\ - export CFLAGS=${CFLAGS_DEPS} &&\ - export LDFLAGS=${LDFLAGS_DEPS} &&\ + export CFLAGS=${CFLAGS} &&\ + export LDFLAGS=${LDFLAGS} &&\ ./configure --disable-dependency-tracking --prefix=${PREFIX} &&\ make -j3 install&&\ cp .libs/libpng.a . &&\ @@ -63,8 +61,8 @@ tar xvfj freetype-${FREETYPEVERSION}.tar.bz2 &&\ cd freetype-${FREETYPEVERSION} &&\ export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\ - export CFLAGS=${CFLAGS_DEPS} &&\ - export LDFLAGS=${LDFLAGS_DEPS} &&\ + export CFLAGS=${CFLAGS} &&\ + export LDFLAGS=${LDFLAGS} &&\ ./configure --prefix=${PREFIX} &&\ make -j3 install &&\ cp objs/.libs/libfreetype.a . &&\ @@ -76,12 +74,22 @@ mpl_build: export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\ - export CFLAGS=${CFLAGS_DEPS} &&\ - export LDFLAGS=${LDFLAGS_DEPS} &&\ - python setup.py build + export CFLAGS=${CFLAGS} &&\ + export LDFLAGS=${LDFLAGS} &&\ + ${PYTHON} setup.py build mpl_install: export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\ - export CFLAGS=${CFLAGS_DEPS} &&\ - export LDFLAGS=${LDFLAGS_DEPS} &&\ - python setup.py install --prefix=${PREFIX} + export CFLAGS=${CFLAGS} &&\ + export LDFLAGS=${LDFLAGS} &&\ + ${PYTHON} setup.py install --prefix=${PREFIX} + + +binaries: + unset PKG_CONFIG_PATH &&\ + cp release/osx/data/setup.cfg release/osx/data/ReadMe.txt . &&\ + export CFLAGS=${CFLAGS} &&\ + export LDFLAGS=${LDFLAGS} &&\ + /Library/Frameworks/Python.framework/Versions/${PYVERSION}/bin/bdist_mpkg --readme=ReadMe.txt &&\ + hdiutil create -srcdir dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.mpkg dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.dmg &&\ + ${PYTHON} setupegg.py bdist_egg This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |