Plot like Ocean Data View

This is the place for queries that don't fit in any of the other categories.

Plot like Ocean Data View

Postby miguelkmps » Fri Oct 04, 2013 12:18 am

Hi python community, I want to make a plot in python like that one produced by Ocean Data View, because I want to make an script to plot in batch mode different locations and I like the way that Ocean Data View present the information.
Thankz in advance for your help.

Image
miguelkmps
 
Posts: 2
Joined: Fri Oct 04, 2013 12:12 am

Re: Plot like Ocean Data View

Postby Kebap » Fri Oct 04, 2013 9:53 am

miguelkmps wrote:I want to make a plot in python

Hi Miguel, I am sure you do. However, in order for us to help you with that, we need some more input. Please check out our thread for new users.
Due to the reasons discussed here we are moving to python-forum.net on October 1, 2016.

This forum will be closed. Please create an account at the new site to continue discussion.

IRC://irc.freenode.net/python-forum
Kebap
 
Posts: 689
Joined: Thu Apr 04, 2013 1:17 pm
Location: Germany, Europe

Re: Plot like Ocean Data View

Postby miguelkmps » Sat Oct 05, 2013 1:53 am

Hi, here is my code, my main problem is that I can't achieved to make the axis border same to the picture posted above.

Code: Select all
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
fig=plt.figure()
ax=fig.add_axes([0.1,0.1,0.8,0.8])
lonmax = -88.059
lonmin = -90.402
latmax = 13.6586
latmin = 12.0408
lon0 = 0.5 * (lonmax + lonmin)
lat0 = 0.5 * (latmax + latmin)

m = Basemap(llcrnrlon=lonmin,llcrnrlat=latmin,urcrnrlon=lonmax,urcrnrlat=latmax,\
            rsphere=(6378137.00,6356752.3142),\
            resolution='l',projection='merc',\
            lat_0=lat0,lon_0=lon0)
m.drawcoastlines()
m.fillcontinents()
m.drawparallels(np.arange(round(latmin),round(latmax),0.5),labels=[1,0,0,1],dashes=[1,0])
m.drawmeridians(np.arange(round(lonmin),round(lonmax),0.5),labels=[1,0,0,1],dashes=[1,0])
ax.set_title('Parametro Graficado')
plt.show()
Attachments
image.png
Here is the image generated with the code. I would like to make the axis border same as the picture above.
image.png (22.33 KiB) Viewed 679 times
miguelkmps
 
Posts: 2
Joined: Fri Oct 04, 2013 12:12 am


Return to General Coding Help

Who is online

Users browsing this forum: Bing [Bot] and 14 guests

cron