Difference between revisions of "File:Parallel Mesh Generation Around the world.png"

From crtc.cs.odu.edu
Jump to: navigation, search
(Additional Assets)
(Additional Assets)
Line 41: Line 41:
 
Sample data:
 
Sample data:
 
<div class="toccolours mw-collapsible mw-collapsed" style="width:600px; overflow:auto;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="width:600px; overflow:auto;">
 +
<syntaxhighlight lang="python" >
  
 
places = dict()
 
places = dict()
Line 134: Line 135:
 
y = lat  
 
y = lat  
 
places['UChile'] = [lon,lat,x,y]
 
places['UChile'] = [lon,lat,x,y]
 +
</syntaxhighlight>
 +
 
</div>
 
</div>

Revision as of 13:03, 7 September 2018

Additional Assets

Script to generate it :

import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
fig=plt.figure(figsize=[15,10])

ax = plt.axes(projection=ccrs.Robinson())
ax.add_feature(cfeature.LAND,facecolor='lightgrey')
#ax.add_feature(cfeature.OCEAN)
ax.add_feature(cfeature.COASTLINE)
ax.add_feature(cfeature.BORDERS)

# make the map global rather than have it zoom in to
# the extents of any plotted data
#ax.set_global()

#ax.set_extent([-160,160,-90,90])


#https://stackoverflow.com/a/25421922
transform = ccrs.PlateCarree()._as_mpl_transform(ax)
for key, value in places.items():
    print(key)
    lon,lat,x,y = value
    # add marker
    plt.plot(lon,lat, marker='D',color='red',markersize=3,transform=ccrs.Geodetic())
    # add text
    plt.annotate(key,xy=(lon,lat), xytext=(x,y),arrowprops=dict(arrowstyle="->",color='red'),xycoords=transform)

# Save the plot by calling plt.savefig() BEFORE plt.show()
#plt.savefig('map.svg')
plt.savefig('map.png',dpi=200,bbox_inches='tight')

plt.show()

Sample data:

places = dict()

# Paris,Saclay INRIA
lat = 48.73668
lon = 2.180034
x = lon -25
y = lat -5
places['INRIA'] = [lon,lat,x,y]

#Swansea
lat = 51.6214 
lon = -3.9436
x = lon - 30
y = lat - 1
places['Swansea'] = [lon,lat,x,y]

# London Imperial
lat = 51.5074
lon = -0.1278
x = lon -40
y = lat + 2
places['Imperial'] = [ lon,lat,x,y]

# Belgium, Université catholique de Louvain
lat = 50.85045
lon = 4.34878
x = lon -45
y = lat -3
places['UCLouvain'] = [lon,lat,x,y]

#Fairfax 
lat = 38.8321946
lon = -77.308036
x = lon +7
y = lat -3
places['GMU'] = [lon,lat,x,y]

#Troy 
lat = 42.7302
lon = -73.6788
x = lon +15
y = lat +1
places['RPI'] = [lon,lat,x,y]

# NASA LaRC
lon = -76.385486
lat = 37.096157
x = lon +15
y = lat -8
places['LaRC'] = [lon,lat,x,y]

# ODU
lat= 36.8466667
lon = -76.2855556
x = lon +15
y = lat -15
places['ODU'] = [lon,lat,x,y]

# St. Louis
lat = 38.627003
lon = -90.199402
x = lon -15
y = lat +5
places['Boeing'] = [lon,lat,x,y]

# UTexas , Austin 
lat = 30.2672
lon = -97.7431
x = lon - 8
y = lat - 15
places['UTexas'] = [lon,lat,x,y]

# Alburquerque
lat = 35.106766
lon =-106.629181
x = lon -15
y = lat +5
places['Sandia'] = [lon,lat,x,y]

# British Columbia , vancouver 
lat = 49.2827
lon = -123.1207
x= lon +10
y = lat +2
places['British Columbia'] = [ lon,lat,x,y]

# Santiago Chile
lon = -70.6666667
lat =  -33.45
x = lon -20
y = lat 
places['UChile'] = [lon,lat,x,y]

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current21:41, 10 September 2018Thumbnail for version as of 21:41, 10 September 20182,372 × 1,226 (542 KB)Ctsolakis (talk | contribs)
18:21, 6 September 2018Thumbnail for version as of 18:21, 6 September 20181,794 × 1,557 (319 KB)Ctsolakis (talk | contribs)
18:06, 6 September 2018Thumbnail for version as of 18:06, 6 September 20181,794 × 1,581 (323 KB)Ctsolakis (talk | contribs)
  • You cannot overwrite this file.

There are no pages that link to this file.