[Matplotlib-users] Basemap - bluemarble doesn't map to zommed in orthographic projection

2014-04-22 Thread Don Morton
Hello,

I'm new to this list (but not matplotlib and basemap), and am not sure if
this is the place to post basemap questions.  I apologise if I have erred.

I'm reporting an issue whereby if I try to plot a zoomed in orthographic
projection with a bluemarble (or etopo or shaded relief) background, the
background remains "global," though it's oriented to the correct location,
not mapping to the zoomed projection coordinates.  I am pasting in a simple
demo code that illustrates the behaviour.  If you use the lcc projection,
all works fine, and if you use a "non-zoomed" ortho projection, the
background maps correctly.

It seems that there is something preventing the background from mapping
into anything but a "complete-domain" ortho projection.  I'm not a great
map person, and I realise I may be missing the boat on the way I'm trying
to zoom my ortho projection, but I'm not sure.

Am I screwing up, or is it a bug?

Thank you,

Don Morton

#---

import mpl_toolkits.basemap as bm
import matplotlib.pyplot as plt
import numpy as np

# Define a lambert conformal over northwest United States
# With this projection (centered on Montana, and zoomed in),
# the background image does map to the zoomed in projection
'''
theMap = bm.Basemap(projection='lcc',
lat_0=47, lat_1=30, lat_2=60, lon_0=-115,
llcrnrlat=43, llcrnrlon=-128,
urcrnrlat=55, urcrnrlon=-105,
resolution='i', area_thresh=1000)
'''

# With this projection (centered on Vienna, and zoomed in),
# the background image doesn't map to the zoomed in projection
theMap = bm.Basemap(projection='ortho',
lat_0=48.2, lon_0=16.4,
llcrnry=-100.0, llcrnrx=-100.0,
urcrnry=100.0, urcrnrx=100.0,
resolution='l', area_thresh=1000)

theMap.drawcountries()
theMap.drawcoastlines()
theMap.bluemarble()
#theMap.shadedrelief()
#theMap.etopo()

plt.show()


---
Don Morton, Owner/Manager
Boreal Scientific Computing LLC
Fairbanks, Alaska USA
http://www.borealscicomp.com/
http://www.borealscicomp.com/Miscellaneous/MortonBio/
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] checking if an artist is in the list of artists for an axes

2014-04-22 Thread Benjamin Root
In most cases, you can also query the artist object for which axes it
belongs to:

ax = a.get_axes()

Note that is can be None if it hasn't been attached anywhere.

Cheers!
Ben Root


On Tue, Apr 22, 2014 at 3:35 AM, Eric Firing  wrote:

> On 2014/04/21 8:30 PM, Michael Mossey wrote:
> > How do I check if an artist is in the list of artists attached to an
> axes?
>
> if a in ax.get_children():
>  ...
>
> Eric
> >
> > Mike
> >
> >
> >
> >
> --
> > Start Your Social Network Today - Download eXo Platform
> > Build your Enterprise Intranet with eXo Platform Software
> > Java Based Open Source Intranet - Social, Extensible, Cloud Ready
> > Get Started Now And Turn Your Intranet Into A Collaboration Platform
> > http://p.sf.net/sfu/ExoPlatform
> >
> >
> >
> > ___
> > Matplotlib-users mailing list
> > Matplotlib-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
>
>
>
> --
> Start Your Social Network Today - Download eXo Platform
> Build your Enterprise Intranet with eXo Platform Software
> Java Based Open Source Intranet - Social, Extensible, Cloud Ready
> Get Started Now And Turn Your Intranet Into A Collaboration Platform
> http://p.sf.net/sfu/ExoPlatform
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Make clear figure used in the powerpoint slides?

2014-04-22 Thread Benjamin Root
Yes, there is a difference if you use the button versus explicitly stating
the dpi in a savefig call. When you use the button, matplotlib has to use
the default dpi since there is no other way to specify it.

Cheers!
Ben Root


On Mon, Apr 21, 2014 at 5:03 PM, Chao YUE  wrote:

> Yes, in fact I set dpi as 1000, which is already very high. In fact I have
> another question, will there be any difference if I use the save button on
> the interactive plotting toolbar and use the command line
> figure.savefig('xx.png',dpi=1000)?
>
> Chao
>
>
> On Mon, Apr 21, 2014 at 10:59 PM, Jody Klymak  wrote:
>
>> Did you set the dpi of the png?
>>
>> Cheers,  Jody
>>
>>
>> On Apr 21, 2014, at  13:50 PM, ChaoYue  wrote:
>>
>> OK, I tried but I don't really see the difference between jpg and png by
>> my eyes in the attached case, maybe for other more complicated plots there
>> will be real difference. Anyway, thanks to all for your nice discussions.
>> And, BTW, I tried >2 hours trying to find a way to convert svg to emf, but
>> now I konw :p
>>
>> Cheers,
>>
>> Chao
>>
>>
>> On Mon, Apr 21, 2014 at 9:49 PM, Benjamin Root-2 [via matplotlib] <[hidden
>> email]> wrote:
>>
>>> JPGs will *always* have "bit blur" as it is a lossy image format. PNGs
>>> would be a better bet.
>>>
>>> Ben Root
>>>
>>>
>>>  On Mon, Apr 21, 2014 at 3:33 PM, ChaoYue <[hidden 
>>> email]
>>> > wrote:
>>>
 Hi all,

 Thank you all for your kind response. I am sorry, but none of these
 solutions significantly improved the visual quality on microsoft powerpiont
 2007. Thought I didn't try eps. So probably l have to go with the current
 quality.
 here is a best case I have now:
 https://www.dropbox.com/s/0uhjogalz92hssm/different_figure_example.pptx
 You can still see the "a bit blur" everywhere (currently with jpg being
 inserted directly). I didn't have better quality than this one by trying
 the method as suggested by you. Let me know if I am raising too much high
 demand for this.

 Cheers,

 Chao


 On Mon, Apr 21, 2014 at 4:41 PM, Jonathan Slavin [via matplotlib] <[hidden
 email] > wrote:

> ​Another alternative, if a vector graphics format doesn't work, is to
> make your png figure large.  Then when you shrink it down to fit in your
> slide, it should still have good resolution.
>
> Jon​
>
> On Mon, Apr 21, 2014 at 10:13 AM, <[hidden 
> email]
> > wrote:
>
>> No Powerpoint version I know supports SVG (or any vector graphics
>> format useful in this case) and Matplotlib does not
>> export WMF graphics anymore. So the easiest way is to use PNGs, if
>> you can live with raster graphics.
>>
>> Alternatively, if you need vector graphics, you can export the
>> Matplotlib plot as SVG and convert it to WMF or EMF using
>> Inkscape. This can be done in the command line like this:
>>
>> "c:\Program Files\Inkscape-0.48\inkscape.exe" --without-gui
>> --export-emf="output.emf" "input.svg"
>>
>>
>>   Juergen
>>
>
>
> --
> 
> Jonathan D. Slavin Harvard-Smithsonian CfA
> [hidden email] 
>60 Garden Street, MS 83
> phone: 
> +16174967981" target="_blank">(617) 496-7981   Cambridge, MA
> 02138-1516
> fax: 
> +16174967577" target="_blank">(617) 496-7577USA
> 
>
>
> --
>
> Start Your Social Network Today - Download eXo Platform
> Build your Enterprise Intranet with eXo Platform Software
> Java Based Open Source Intranet - Social, Extensible, Cloud Ready
> Get Started Now And Turn Your Intranet Into A Collaboration Platform
> http://p.sf.net/sfu/ExoPlatform
> ___
> Matplotlib-users mailing list
> [hidden email] 
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
> --
>  If you reply to this email, your message will be added to the
> discussion below:
>
> http://matplotlib.1069221.n5.nabble.com/Make-clear-figure-used-in-the-powerpoint-slides-tp43252p43262.html
>  To start a new topic under matplotlib - users, email [hidden 
> email]
> To unsubscribe from matplotlib, click here.
> NAML

Re: [Matplotlib-users] checking if an artist is in the list of artists for an axes

2014-04-22 Thread Eric Firing
On 2014/04/21 8:30 PM, Michael Mossey wrote:
> How do I check if an artist is in the list of artists attached to an axes?

if a in ax.get_children():
 ...

Eric
>
> Mike
>
>
>
> --
> Start Your Social Network Today - Download eXo Platform
> Build your Enterprise Intranet with eXo Platform Software
> Java Based Open Source Intranet - Social, Extensible, Cloud Ready
> Get Started Now And Turn Your Intranet Into A Collaboration Platform
> http://p.sf.net/sfu/ExoPlatform
>
>
>
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>


--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users