contourf linewidth=1 help request

Hi, I hope this is the proper place to send this message. I'm using matplotlib to make contourf plots with contour overlays. My problem is that I want to be able to use .25 pica lines for the overlaid contours, but since contourf demands a linethickness of 1. to avoid artifacts (due to the simply-connected domain contour algorhithm), the .25 contours don't actually fit the contourf right; there will be a thin line of color from the next contour around the contourf before the .25 pica line appears. This annoys me to no end.

Currently I'm fixing it by plotting everything 4x larger than normal and then shrinking the eps files down in Illustrator, but this is not an ideal solution, since (for example) all the axis labels are in the wrong position at this size. My question is, how hard would it be to fix the contour code so that contourf's linethickness argument could be changed? Where in the codebase would I look to start hacking? In the contouring code? In the python code that accepts the contour algorithm output? I don't want to spend hours hunting through the code for the right place to start modifying things...

Jordan

Jordan,

Would you send a simple example script and sample plot, please? If I understand correctly what you are trying to do, it should work.

Thanks.

Eric

Jordan Dawe wrote:

···

Hi, I hope this is the proper place to send this message. I'm using matplotlib to make contourf plots with contour overlays. My problem is that I want to be able to use .25 pica lines for the overlaid contours, but since contourf demands a linethickness of 1. to avoid artifacts (due to the simply-connected domain contour algorhithm), the .25 contours don't actually fit the contourf right; there will be a thin line of color from the next contour around the contourf before the .25 pica line appears. This annoys me to no end.

Currently I'm fixing it by plotting everything 4x larger than normal and then shrinking the eps files down in Illustrator, but this is not an ideal solution, since (for example) all the axis labels are in the wrong position at this size. My question is, how hard would it be to fix the contour code so that contourf's linethickness argument could be changed? Where in the codebase would I look to start hacking? In the contouring code? In the python code that accepts the contour algorithm output? I don't want to spend hours hunting through the code for the right place to start modifying things...

Jordan

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Eric Firing wrote:

Jordan,

Would you send a simple example script and sample plot, please? If I understand correctly what you are trying to do, it should work.

Ok, I stuck an example on my webserver. The script (heavily copied from contour_demo.py):

http://freedryk.dyndns.org:8080/matplotlib/example.py

The eps output:

http://freedryk.dyndns.org:8080/matplotlib/example.eps

And, in case it's easier for you, the eps output converted into pdf:

http://freedryk.dyndns.org:8080/matplotlib/example.pdf

The problem can be seen by zooming into one of the contour lines. There is about a .25 pica space between the contour lines and the filled contours. This doesn't occur if you use a 1 pica line, but I don't like thick lines...

Jordan

Jordan,

The correction--using a small linewidth for the patch boundary (which is the same color as the patch)--has been committed to CVS. Thanks for pointing out the problem.

Eric

Jordan Dawe wrote:

···

Eric Firing wrote:

Jordan,

Would you send a simple example script and sample plot, please? If I understand correctly what you are trying to do, it should work.

Ok, I stuck an example on my webserver. The script (heavily copied from contour_demo.py):

http://freedryk.dyndns.org:8080/matplotlib/example.py

The eps output:

http://freedryk.dyndns.org:8080/matplotlib/example.eps

And, in case it's easier for you, the eps output converted into pdf:

http://freedryk.dyndns.org:8080/matplotlib/example.pdf

The problem can be seen by zooming into one of the contour lines. There is about a .25 pica space between the contour lines and the filled contours. This doesn't occur if you use a 1 pica line, but I don't like thick lines...

Jordan