Jouni K. Seppänen | 1 Jan 12:04
Face
Picon
Picon
Picon
Favicon
Gravatar

Re: eps/pdf/svg contourf contours don't overlap properly with high resolution data

Jordan Dawe <jdawe@...> writes:

> Contourf plots that I output in vector format files have little
> triangular glitches at the contour boundaries if the contoured array
> is larger than about 200x200. The same files in png format are
> perfect, even at very high dpi values.

The current svn trunk doesn't have the really jarring little triangles
(at least in the pdf output), but there are still several very obtuse
white triangles between the regions. Rasterization at a high dpi makes
the output somewhat better at the cost of larger output files:

c=contourf(X, Y, Z, 10)
axis((-3, 3, -3, 3))
savefig('unrasterized.pdf')
for d in c.collections:
    d.set_rasterized(True)
savefig('rasterized.pdf',dpi=200)

Attachment (unrasterized.pdf): application/pdf, 12 KiB
Attachment (rasterized.pdf): application/pdf, 69 KiB

--

-- 
Jouni K. Seppänen
http://www.iki.fi/jks
------------------------------------------------------------------------------
(Continue reading)

Eric Firing | 2 Jan 00:58
Favicon
Gravatar

Re: eps/pdf/svg contourf contours don't overlap properly with high resolution data

Jouni K. Seppänen wrote:
> Jordan Dawe <jdawe@...> writes:
> 
>> Contourf plots that I output in vector format files have little
>> triangular glitches at the contour boundaries if the contoured array
>> is larger than about 200x200. The same files in png format are
>> perfect, even at very high dpi values.
> 
> The current svn trunk doesn't have the really jarring little triangles
> (at least in the pdf output), but there are still several very obtuse
> white triangles between the regions. Rasterization at a high dpi makes
> the output somewhat better at the cost of larger output files:
> 
> c=contourf(X, Y, Z, 10)
> axis((-3, 3, -3, 3))
> savefig('unrasterized.pdf')
> for d in c.collections:
>     d.set_rasterized(True)
> savefig('rasterized.pdf',dpi=200)

At least in the trunk--and maybe in 0.99.0--the problem is caused by 
path simplification.  In the trunk, for the eps file, it goes away 
completely if I use a matplotlibrc with

path.simplify : False

In the trunk, what seems to be happening is that when a contour boundary 
is almost straight, but has an inflection point, the curves for the 
adjacent patch boundaries are simplified slightly differently.  This is 
not surprising; if nothing else, the path will be traveled in a 
(Continue reading)

Alan G Isaac | 2 Jan 19:33
Picon

Re: Problem with multiple plots

http://matplotlib.sourceforge.net/faq/howto_faq.html#use-show

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
jm982 | 3 Jan 04:31
Picon
Favicon

Re: Problem with multiple plots


AlanIsaac wrote:
> 
> http://matplotlib.sourceforge.net/faq/howto_faq.html#use-show
> 
> 

Thanks.  Obviously, I did not do a good enough job reading the faq...
--

-- 
View this message in context: http://old.nabble.com/Problem-with-multiple-plots-tp26976541p26998858.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
Picon

query about pyplot.text example


The online documentation at URL=
http://www.scipy.org/Cookbook/Matplotlib/Maps has an example that uses
plt.text as follows:

plt.text(xpt+50000,ypt+50000,name)

Why is the offset 50000?
--

-- 
View this message in context: http://old.nabble.com/query-about-pyplot.text-example-tp26999119p26999119.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
Eric Firing | 3 Jan 07:19
Favicon
Gravatar

Re: query about pyplot.text example

Dr. Phillip M. Feldman wrote:
> The online documentation at URL=
> http://www.scipy.org/Cookbook/Matplotlib/Maps has an example that uses
> plt.text as follows:
> 
> plt.text(xpt+50000,ypt+50000,name)
> 
> Why is the offset 50000?

The proj library used by Basemap transforms lon, lat to meters, so xpt 
and ypt are in meters.  Hence the offsets are 50 km.  Now, what I don't 
understand is why the San Diego offset on the map looks so much larger 
than the Boulder offset, for example.

Eric

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
Phillip M. Feldman | 3 Jan 08:02
Picon

Re: query about pyplot.text example

Ah.  It sounds as though one must consider the scale of the map, and 
then choose these offsets so that the text falls near but not too near 
the marker.  It would be great if one could specify the text offsets in 
units of the font size rather than in units of map distance.

Thanks!

Phillip

Eric Firing wrote:
> Dr. Phillip M. Feldman wrote:
>> The online documentation at URL=
>> http://www.scipy.org/Cookbook/Matplotlib/Maps has an example that uses
>> plt.text as follows:
>>
>> plt.text(xpt+50000,ypt+50000,name)
>>
>> Why is the offset 50000?
>
> The proj library used by Basemap transforms lon, lat to meters, so xpt 
> and ypt are in meters.  Hence the offsets are 50 km.  Now, what I 
> don't understand is why the San Diego offset on the map looks so much 
> larger than the Boulder offset, for example.
>
> Eric
>

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
(Continue reading)

Ryan May | 3 Jan 17:22
Picon
Gravatar

Re: query about pyplot.text example

On Sun, Jan 3, 2010 at 1:02 AM, Phillip M. Feldman <pfeldman@...> wrote:
> Ah.  It sounds as though one must consider the scale of the map, and
> then choose these offsets so that the text falls near but not too near
> the marker.  It would be great if one could specify the text offsets in
> units of the font size rather than in units of map distance.

You can do it, it just takes a bit of knowledge about how different
transformations are used under the hood:

import matplotlib.transforms as mtransforms
import matplotlib.pyplot as plt

# Basic plot of single point. Adjust limits to give space
x0,y0 = 4,5
plt.plot(x0, y0, 'o')
plt.ylim(-10, 20)
plt.xlim(0, 15)

# Grab axes object so we can get the tranformation used to
# transform data points into axes coords
ax = plt.gca()

# Create a transform that moves to the data point and then
# adds an offset of 10 up (I'm not sure if it's points or pixels)
# Transforms can be combined using just the simple '+'
trans = ax.transData + mtransforms.Affine2D().translate(0, 10)
plt.text(x0, y0, 'Testing', horizontalalignment='center',
    verticalalignment='center', transform=trans, clip_on=True)

# Now do one 15 right
(Continue reading)

Jordan Dawe | 3 Jan 17:56
Picon
Picon
Favicon

Re: eps/pdf/svg contourf contours don't overlap properly with high resolution data


> Jouni K. Sepp?nen wrote:
>   
>> Jordan Dawe <jdawe@...> writes:
>>
>>     
>>> Contourf plots that I output in vector format files have little
>>> triangular glitches at the contour boundaries if the contoured array
>>> is larger than about 200x200. The same files in png format are
>>> perfect, even at very high dpi values.
>>>       
>> The current svn trunk doesn't have the really jarring little triangles
>> (at least in the pdf output), but there are still several very obtuse
>> white triangles between the regions. Rasterization at a high dpi makes
>> the output somewhat better at the cost of larger output files:
>>
>> c=contourf(X, Y, Z, 10)
>> axis((-3, 3, -3, 3))
>> savefig('unrasterized.pdf')
>> for d in c.collections:
>>     d.set_rasterized(True)
>> savefig('rasterized.pdf',dpi=200)
>>     
>
>
> At least in the trunk--and maybe in 0.99.0--the problem is caused by 
> path simplification.  In the trunk, for the eps file, it goes away 
> completely if I use a matplotlibrc with
>
> path.simplify : False
(Continue reading)

Alexander Hupfer | 3 Jan 18:34
Picon

Colorbar embedding in qt4

Hi, I have a scatter plot embedded in qt4 according to http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_qt4.html what works fine
However if I try to add a colorbar to it by simply calling

p = scatter(....)
colorbar(p)

I get an error that says that something is outside the drawable area.

- sonium

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Gmane