Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9254913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:35:33+00:00 2026-06-18T11:35:33+00:00

I use orthographic projection to plot maps. I use this programm: from mpl_toolkits.basemap import

  • 0

I use orthographic projection to plot maps.
I use this programm:

from mpl_toolkits.basemap import Basemap
import numpy as np    
import matplotlib.pyplot as plt   
import os, sys    
from sys import argv   
import pylab    
from mpl_toolkits.basemap import Basemap, shiftgrid    
from matplotlib import mpl     
from matplotlib import rcParams    
import matplotlib.pyplot as plt    
import matplotlib.mlab as mlab    
import matplotlib.patches as patches    
import matplotlib.path as path    
import matplotlib.dates as dt    
from numpy import linalg    
import netCDF4    
import time    
import datetime as d   
import sys    
import math    
from mpl_toolkits.axes_grid1 import make_axes_locatable   
from pylab import *


nc = netCDF4.Dataset ('tt.nc')    
latvar = nc.variables['lat']    
lat = latvar[:]    
lon = nc.variables['lon'][:]    
lat_0=30;lon_0=-25    
m1 = Basemap(projection='ortho',lon_0=-25,lat_0=30,resolution='l')    
m = Basemap(projection='ortho',lon_0=lon_0,lat_0=lat_0,resolution='l',\
    llcrnrx=0.,llcrnry=0.,urcrnrx=m1.urcrnrx/2.,urcrnry=m1.urcrnry/2.)

X, Y = m(lon, lat)    
O_x_1=nc.variables['O3']   
h=9    
lev=0    
minOzone=0    
maxOzone=40    
plotOzone = m.pcolor(X,Y,O_x_1[h,lev,:,:],vmin=minOzone,vmax=maxOzone)
ax=colorbar(plotOzone, shrink=0.8,norm=(0,40))    
m.drawcoastlines()   
m.drawparallels(np.arange(-90.,120.,30.))    
m.drawmeridians(np.arange(0.,420.,60.))    
plt.show()

What do I have to do to center my map
on Europe ?

I have already played with lat_0 and lon_0 but that doesn’t
give what I want…

I can’t add figures to show what I obtained and
what I would like…

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:35:34+00:00Added an answer on June 18, 2026 at 11:35 am

    The lat_0 and lon_0 are for setting the origin of the projection, not the extent of the map. Usually the place with the least distortions so you dont want the origin to deviate too much from the center of your area of interest. Basemap will automatically center the map around the origin if you dont specify an extent.

    Centering the map (different from its origin) can be done if you know what extent (or boundingbox) you want to use. If you know the corner coordinates in your ‘ortho’ projection you could use the keywords from your example (llcrnrx etc.). I have had no luck with the ‘llcrnrlon’ keywords in Basemap 1.0.6, they seem to suggest that you can input the coordinates of your extent in geographic (lat/lon).

    An alternative is to grab the axes and manually set an x- and y limit. A benefit is that you can do it after declaring the Basemap object which you can then use for coordinate transformation. An example:

    from mpl_toolkits.basemap import Basemap
    
    fig = plt.figure(figsize=(5,5))
    
    m = Basemap(projection='ortho',lon_0=5,lat_0=35,resolution='l')
    
    m.drawcoastlines()
    m.drawparallels(np.arange(-90.,120.,15.))
    m.drawmeridians(np.arange(0.,420.,30.))
    
    # your extent in lat/lon (dec degrees)
    ulx = -10
    uly = 65
    lrx = 65
    lry = 35
    
    # transform coordinates to map projection
    xmin, ymin = m(ulx, lry)
    xmax, ymax = m(lrx, uly)
    
    # set the axes limits
    ax = plt.gca()
    ax.set_xlim(xmin, xmax)
    ax.set_ylim(ymin, ymax)
    

    Make sure the projection in the map declaration suites your needs, i have just picked an origin which falls within Europe.

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I try to use my orthographic projection, I'm not getting the result I'm
Assuming I use Orhographic Projection, and have a reshape function like this: void reshape(f32
Use Eclipse Classic with ADT plugin. Tried to make project from existing example of
use strict; use Time::HiRes qw[gettimeofday tv_interval]; my $start_index = int(rand(50))+100;#this value is arbitrary for
Use trap to capture signals like this: i=-1;while((++i<33)); do trap echo $i >> log.txt
use DBI(); What is causing this insert to fail to err 1, the SELECT
USE AdventureWorks; GO BEGIN TRANSACTION; GO DELETE FROM HumanResources.JobCandidate WHERE JobCandidateID = 10; DELETE
'''use Jython''' import shutil print dir(shutil) There is no, shutil.move, how does one move
I was wondering if there is any benefit to using an orthographic projection camera,
Use Case Show a photo uploaded by the user in a square box with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.