From: lmkli <ken...@gm...> - 2010-03-22 06:40:14
|
When I use contourf to plot a filled contour map, I get some white-like lines between each color patches. This is not like the contourf doc string says: "it does not draw the polygon edges.", actually, it does. http://old.nabble.com/file/p27982822/contourf1.png contourf1.png The figure above is what I get by contourf, but this is not exactlly what I want. The filled contour map I want should be like this one: http://old.nabble.com/file/p27982822/contourf2.png contourf2.png Any advices? Thank you! -- View this message in context: http://old.nabble.com/contourf-creats-white-like-lines-%28or-gaps%29-between-each-color-patches-tp27982822p27982822.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Marius 't H. <mar...@gm...> - 2010-03-22 15:07:38
|
Actually, it does not draw the polygon edges, but leaves small gaps between them. Through those gaps you can see the background. (This also happens with polar plots and other polygons by the way.) I consider this a bug, though there are ways around it. For contour plots one can plot two contourplots over each other, one with different levels (or a different number of levels) than the other. Messy, but it works. Marius. lmkli wrote: > When I use contourf to plot a filled contour map, I get some white-like lines > between each two color patches, or you can call them gaps. > This is not like the contourf doc string says: "it does not draw the > polygon edges.", actually, it does. > http://old.nabble.com/file/p27982822/contourf1.png contourf1.png > The figure above is what I get by contourf, but this is not exactlly what I > want. > > The filled contour map I want should be like this one: > http://old.nabble.com/file/p27982822/contourf2.png contourf2.png > > Any advice? > > Thank you! > |
From: lmkli <ken...@gm...> - 2010-03-23 04:24:09
|
Thank you! I just thought there must be a solution. I saw someone posted he can modified contour.py to fix this, but I failed. :( Marius 't Hart-3 wrote: > > Actually, it does not draw the polygon edges, but leaves small gaps > between them. Through those gaps you can see the background. (This also > happens with polar plots and other polygons by the way.) I consider this > a bug, though there are ways around it. For contour plots one can plot > two contourplots over each other, one with different levels (or a > different number of levels) than the other. Messy, but it works. > > Marius. > > lmkli wrote: >> When I use contourf to plot a filled contour map, I get some white-like >> lines >> between each two color patches, or you can call them gaps. >> This is not like the contourf doc string says: "it does not draw the >> polygon edges.", actually, it does. >> http://old.nabble.com/file/p27982822/contourf1.png contourf1.png >> The figure above is what I get by contourf, but this is not exactlly what >> I >> want. >> >> The filled contour map I want should be like this one: >> http://old.nabble.com/file/p27982822/contourf2.png contourf2.png >> >> Any advice? >> >> Thank you! >> > > > ------------------------------------------------------------------------------ > 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-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/contourf-creats-white-like-lines-%28or-gaps%29-between-each-two-color-patches-tp27982822p27996271.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Eric F. <ef...@ha...> - 2010-03-25 16:04:34
|
lmkli wrote: > Thank you! > > I just thought there must be a solution. > I saw someone posted he can modified contour.py to fix this, but I failed. > :( > What version of mpl are you using? Are you modifying the default anti-aliasing in the patch collections that contour is creating? Are you seeing the problem when using the ps and pdf backends, or only with agg (that is, creating png files directly)? There are two problems that can contribute to this, one related to the way the agg backend handles the boundaries between filled regions, and the other a bug in path simplification, which has been fixed in svn. Eric > > Marius 't Hart-3 wrote: >> Actually, it does not draw the polygon edges, but leaves small gaps >> between them. Through those gaps you can see the background. (This also >> happens with polar plots and other polygons by the way.) I consider this >> a bug, though there are ways around it. For contour plots one can plot >> two contourplots over each other, one with different levels (or a >> different number of levels) than the other. Messy, but it works. >> >> Marius. >> >> lmkli wrote: >>> When I use contourf to plot a filled contour map, I get some white-like >>> lines >>> between each two color patches, or you can call them gaps. >>> This is not like the contourf doc string says: "it does not draw the >>> polygon edges.", actually, it does. >>> http://old.nabble.com/file/p27982822/contourf1.png contourf1.png >>> The figure above is what I get by contourf, but this is not exactlly what >>> I >>> want. >>> >>> The filled contour map I want should be like this one: >>> http://old.nabble.com/file/p27982822/contourf2.png contourf2.png >>> >>> Any advice? >>> >>> Thank you! >>> >> >> ------------------------------------------------------------------------------ >> 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-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > |
From: lmkli <ken...@gm...> - 2010-04-11 18:56:43
|
> What version of mpl are you using? My mpl version is 0.99.1 > Are you modifying the default anti-aliasing in the patch collections that > contour is creating? Could you please tell me how to this? I am very new to matplotlib, thank you very much if you can give me some advices. >Are you seeing the problem when using the ps and pdf backends, or only with agg (that is, creating png files directly)? So far I only creating png files directly. Also, how to use ps and pdf backend? > ....which has been fixed in svn. Do you mean I should download another mpl by svn? Thank you for your answers very much! efiring wrote: > > What version of mpl are you using? Are you modifying the default > anti-aliasing in the patch collections that contour is creating? Are you > seeing the problem when using the ps and pdf backends, or only with agg > (that is, creating png files directly)? > > There are two problems that can contribute to this, one related to the > way the agg backend handles the boundaries between filled regions, and > the other a bug in path simplification, which has been fixed in svn. > > Eric > > > ------------------------------------------------------------------------------ > 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-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/contourf-creats-white-like-lines-%28or-gaps%29-between-each-two-color-patches-tp27982822p28210898.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Eric F. <ef...@ha...> - 2010-04-12 01:10:36
|
lmkli wrote: >> What version of mpl are you using? > My mpl version is 0.99.1 > >> Are you modifying the default anti-aliasing in the patch collections that >> contour is creating? > Could you please tell me how to this? I am very new to matplotlib, thank you > very much if you can give me some advices. see below. > >> Are you seeing the problem when using the ps and pdf backends, or only with > agg (that is, creating png files directly)? > So far I only creating png files directly. Also, how to use ps and pdf > backend? The easiest way is with the pyplot savefig command: e.g. savefig("test.pdf") to save the current figure as a pdf. It doesn't look to me like this solves the problem, though. > >> ....which has been fixed in svn. > Do you mean I should download another mpl by svn? That might help, but it probably won't cure the problem completely. I don't know that there is any combination of parameters that gives boundaries as smooth and gap-free as in your second example. You may get a bit closer to it like this: CS = contourf(Z) for c in CS.collections: c.set_antialiased(False) (If working interactively in ipython, follow this with a "draw()" command to force a redraw.) Eric > > Thank you for your answers very much! > > > efiring wrote: >> What version of mpl are you using? Are you modifying the default >> anti-aliasing in the patch collections that contour is creating? Are you >> seeing the problem when using the ps and pdf backends, or only with agg >> (that is, creating png files directly)? >> >> There are two problems that can contribute to this, one related to the >> way the agg backend handles the boundaries between filled regions, and >> the other a bug in path simplification, which has been fixed in svn. >> >> Eric >> >> >> ------------------------------------------------------------------------------ >> 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-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > |
From: lmkli <ken...@gm...> - 2010-04-12 15:17:07
|
> CS = contourf(Z) > for c in CS.collections: > c.set_antialiased(False) Eric, Thank you! I like this very much! So, the last thing is, is there any way to set this antialiased feature to False by default? efiring wrote: > > lmkli wrote: >>> What version of mpl are you using? >> My mpl version is 0.99.1 >> >>> Are you modifying the default anti-aliasing in the patch collections >>> that >>> contour is creating? >> Could you please tell me how to this? I am very new to matplotlib, thank >> you >> very much if you can give me some advices. > > see below. > >> >>> Are you seeing the problem when using the ps and pdf backends, or only >>> with >> agg (that is, creating png files directly)? >> So far I only creating png files directly. Also, how to use ps and pdf >> backend? > > The easiest way is with the pyplot savefig command: e.g. > > savefig("test.pdf") > > to save the current figure as a pdf. > > It doesn't look to me like this solves the problem, though. > >> >>> ....which has been fixed in svn. >> Do you mean I should download another mpl by svn? > > That might help, but it probably won't cure the problem completely. I > don't know that there is any combination of parameters that gives > boundaries as smooth and gap-free as in your second example. You may > get a bit closer to it like this: > > CS = contourf(Z) > for c in CS.collections: > c.set_antialiased(False) > > (If working interactively in ipython, follow this with a "draw()" > command to force a redraw.) > > Eric > >> >> Thank you for your answers very much! >> >> >> efiring wrote: >>> What version of mpl are you using? Are you modifying the default >>> anti-aliasing in the patch collections that contour is creating? Are you >>> seeing the problem when using the ps and pdf backends, or only with agg >>> (that is, creating png files directly)? >>> >>> There are two problems that can contribute to this, one related to the >>> way the agg backend handles the boundaries between filled regions, and >>> the other a bug in path simplification, which has been fixed in svn. >>> >>> Eric >>> >>> >>> ------------------------------------------------------------------------------ >>> 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-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> >> > > > ------------------------------------------------------------------------------ > 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-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/contourf-creats-white-like-lines-%28or-gaps%29-between-each-two-color-patches-tp27982822p28219132.html Sent from the matplotlib - users mailing list archive at Nabble.com. |