Limit data for plot Basemap

Hi all

I have to plot seismic data on a worldmap and use the Basemap framework to do it.
My dataset contains important data in the range of -1e-8 to -1e-14 and 1e-14 to 1e-9. Can I limit the plot to only display data in this range?

thanks and greets

How are you plotting your data (plot, pcolor, scatter, etc?). Also, is that range the range of values in your arrays, or are they some sort of coordinate ranges?

Cheers!
Ben Root

···

On Fri, Aug 24, 2012 at 11:57 AM, John Bluee <b7u33r@…287…> wrote:

Hi all

I have to plot seismic data on a worldmap and use the Basemap framework to do it.

My dataset contains important data in the range of -1e-8 to -1e-14 and 1e-14 to 1e-9. Can I limit the plot to only display data in this range?

thanks and greets

I have lat and lon as coordinates and to each point a value. So far I use contourf to plot.

···

Am 24.08.2012 um 18:14 schrieb Benjamin Root <ben.root@…1304…>:

On Fri, Aug 24, 2012 at 11:57 AM, John Bluee <b7u33r@…287…> wrote:

Hi all

I have to plot seismic data on a worldmap and use the Basemap framework to do it.

My dataset contains important data in the range of -1e-8 to -1e-14 and 1e-14 to 1e-9. Can I limit the plot to only display data in this range?

thanks and greets

How are you plotting your data (plot, pcolor, scatter, etc?). Also, is that range the range of values in your arrays, or are they some sort of coordinate ranges?

Cheers!
Ben Root

Sorry for not getting back to you sooner. May I suggest the following:

values = np.ma.masked_outside(values, -1e-8, 1e-9, copy=False)
values = np.ma.masked_inside(values, -1e-14, 1e14, copy=False)

And then contourf the masked values array. Any places where the values are masked will be blank.

I hope this helps!
Ben Root

···

On Fri, Aug 24, 2012 at 12:21 PM, John Bluee <b7u33r@…287…> wrote:

I have lat and lon as coordinates and to each point a value. So far I use contourf to plot.