[matplotlib-devel] Bug in eps output of matplotlib
I'm running v0.99.1.2 on Debian Linux, 32 bit Intel. A colorbar on the right with negative labels produces postscript-eps output which displays ok with gv or evince. But when conversion of the ps/eps file to pdf is made, the negative labels get replaced by dashes when the pdf is viewed by xpdf or evince. A variety of pdf conversion methods (ps2pdf, pdflatex) were used, all with the same result. I am including a simple sample python script which creates a graphic with the problem: - #!/usr/bin/python from numpy import * import matplotlib.pyplot as plt # this demos a bug in the eps output x = linspace(0,6,13) y = linspace(0,3,7) (X,Y) = meshgrid(x,y) a = 3.5*sin(X)*sin(Y) c = plt.contourf(x,y,a) b = plt.colorbar(c, orientation = 'vertical') lx = plt.xlabel('x') ly = plt.ylabel('y') ax = plt.axis([0,6,0,3]) plt.show() - Xpdf outputs the following error messages: Error: Bad bounding box in Type 3 glyph Error: Missing or bad Type3 CharProc entry Error: Bad bounding box in Type 3 glyph Error: Missing or bad Type3 CharProc entry Error: Bad bounding box in Type 3 glyph Error: Missing or bad Type3 CharProc entry Error: Bad bounding box in Type 3 glyph Error: Missing or bad Type3 CharProc entry Error: Bad bounding box in Type 3 glyph Error: Missing or bad Type3 CharProc entry Error: Bad bounding box in Type 3 glyph Error: Missing or bad Type3 CharProc entry Error: Bad bounding box in Type 3 glyph Error: Missing or bad Type3 CharProc entry Error: Bad bounding box in Type 3 glyph Error: Missing or bad Type3 CharProc entry These don't appear if there are no negative numbers in the colorbar scale. Dave Raymond PS -- I haven't filed a bug report because I haven't been able to figure out the Source Forge bug reporting system yet. -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
[matplotlib-devel] Elusive bug plotting masked arrays
I am trying to plot two 1-D masked arrays against each other in a line plot and an extraneous straight line appears on the plot. This phenomenon only occurs sporadically and with certain data sets. I have noticed a similar phenomenon with masked arrow arrays, but that is much harder to track down. The masked elements are intended to break the plot line so that several independent polylines are plotted. (The purpose is to plot a map of coastal outlines.) I am attaching a python script which reproduces the problem, but only with a particular data set, which is also attached. Sorry, if I try to shorten the data set more than I have already, the problem goes away, even if I split the file in half an plot each half separately! I am running on a 32 bit intel processor using debian testing and the numpy and matplotlib versions are 1.3 and 0.99.1.2. However, the problem also appears on a 64 bit amd processor running debian stable with numpy and matplotlib versions 1.3 and 0.99.1.1. The python script is named maskbug.py and the data set is trunc1.dat, which is an ascii file. The data set should be read on the standard input, i. e., maskbug.py < trunc1.dat I have verified by printing the masked arrays that nothing appears to go wrong in the conversion from ascii to numpy masked array. Dave Raymond Physics Dept. New Mexico Tech Socorro, NM 87801 #!/usr/bin/python # this illustrates a bug which occurs when plotting masked data import sys from numpy import * import matplotlib.pyplot as plt # get lon-lat data from standard input and store in lists lonl = [] latl = [] while 1: inline = sys.stdin.readline() if inline == '': break else: pieces = inline.split() lonl.append(float(pieces[0])) latl.append(float(pieces[1])) # convert lists to numpy arrays lon = array(lonl) lat = array(latl) # compute masks -- masked elements have values of 1.e30 masklon = lon > 0.999e30 masklat = lat > 0.999e30 # compute masked arrays mlon = ma.array(lon, mask = masklon) mlat = ma.array(lat, mask = masklat) # list input file print mlon print mlat # plot them cc = plt.plot(mlon,mlat) ax = plt.axis([120,150,0,30]) plt.show() trunc1.dat Description: Netscape Proxy Auto Config -- Download IntelĀ® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] Elusive bug plotting masked arrays
On Fri, Mar 19, 2010 at 05:47:05PM -1000, Eric Firing wrote: > David J. Raymond wrote: > >I am using python 2.5.5 and the gtk background (as far as I can tell). > >Turning off path.simplify gets rid of the extraneous line. I am > >attaching pngs with path.simplify both on and off. I am also > >attaching the full coastline file that produced the original problem. > >I noticed that the behavior was a bit weird, with the bad line > >appearing or disappearing in apparently random ways depending on what > >was edited out of the input file. > > This looks to me like a bug that Mike fixed, maybe the one where a > path was not always starting with a move_to. That was fixed on > October 22. Would this fix have made it into version 0.99.1.2 which I am currently using? Dave -- Download IntelĀ® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel