![]() ![]() drawcoastlines () #Drawing the zoom rectangles: lbx1, lby1 = map1 ( * map2 ( map2. fillcontinents ( color = '#ddaa66', lake_color = '#9999FF' ) map3. drawmapboundary ( fill_color = '#9999FF' ) map3. drawcoastlines () map3 = Basemap ( llcrnrlon = - 1. fillcontinents ( color = '#ddaa66', lake_color = '#9999FF' ) map2. drawmapboundary ( fill_color = '#9999FF' ) map2. drawcoastlines () map2 = Basemap ( projection = 'cyl', llcrnrlon =- 15, llcrnrlat = 30, urcrnrlon = 15. fillcontinents ( color = '#ddaa66', lake_color = '#9999FF' ) map1. drawmapboundary ( fill_color = '#9999FF' ) map1. Import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap from matplotlib.path import Path import matplotlib.patches as patches fig = plt. The result is the same as in the previous example When creating the basemap instance, the ax argument must be passed, using the created axes. ![]() The subplots method returns figure object, and a list of the created axes (subplots), where the first element is the one at the top-left position.The arguments passed to the subplots method, are the number of rows and columns to be created.fillcontinents ( color = 'coral', lake_color = 'aqua' ) map. drawmapboundary ( fill_color = 'aqua' ) map. set_title ( "Robinson projection" ) map = Basemap ( projection = 'robin', lon_0 = 10, lat_0 = 50, ax = axes ) map. set_title ( "Hammer projection" ) map = Basemap ( projection = 'hammer', lon_0 = 10, lat_0 = 50, ax = axes ) map. Import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap fig, axes = plt. A title can be added to each subplot using set_title().Once the axis is created, the map created later will use it automatically (although the ax argument can be passed to use the selected axis).# Which axis (subplot) to use, counting from the one top-left axis, as explained at this StackOverflow question # The number of columns in the final figure The three numbers are: # The number of rows in the final figure Before calling the basemap constructor, the fig.add_subplot method is called.set_title ( "Robinson projection" ) map = Basemap ( projection = 'robin', lon_0 = 10, lat_0 = 50 ) map. set_title ( "Hammer projection" ) map = Basemap ( projection = 'hammer', lon_0 = 10, lat_0 = 50 ) map. plot ( 'x_values', 'z_values', data =df, marker = 'o', color = "orange", alpha = 0.Import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap fig = plt. plot ( 'x_values', 'z_values', data =df, marker = 'o', color = "grey", alpha = 0.3 ) # The last one is spread on 1 column only, on the 4th column of the second line.Īx3 = plt. plot ( 'x_values', 'y_values', data =df, marker = 'o', alpha = 0.4 ) # The second one is on column2, spread on 3 columnsĪx2 = plt. DataFrame ( ) # 4 columns and 2 rows # The first plot is on line 1, and is spread all along the 4 columnsĪx1 = plt. # libraries and data from matplotlib import pyplot as pltĭf =pd. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |