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 8022077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:10:06+00:00 2026-06-04T22:10:06+00:00

I am beginning to use Python for my scientific computing, and I am really

  • 0

I am beginning to use Python for my scientific computing, and I am really liking it a lot, however I am confused by a feature of the matplotlib.pylab.legend function. In particular, the location feature allows one to specifiy the location of their legend using numbers, following this scheme:

  • best — 0
  • upper right — 1
  • upper left — 2
  • lower left — 3
  • lower right — 4
  • right — 5
  • center left — 6
  • center right — 7
  • lower center — 8
  • upper center — 9
  • center — 10

Does anyone know why you wouldn’t use the ordering on the numpad? I.e. center — 5, upper right — 9, etc.

I am just curious if anyone knows.

  • 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-04T22:10:07+00:00Added an answer on June 4, 2026 at 10:10 pm

    The docs show this example:

    legend( ('label1', 'label2', 'label3'), loc='upper left')
    

    Presumably, you could write loc=2, but why would you? It’s much more readable to use the English word.

    As to why they didn’t enumerate the values to align with the numeric keypad, I presume they weren’t thinking about the numeric keypad at the time.

    Edit: It’s worth including here the full text of Joe Kington‘s comment:

    Actually, they were deliberately mimicking matlab’s behavior at the
    time. See the “obsolete location values” section in the documentation
    for MATLAB’s legend: mathworks.com/help/techdoc/ref/legend.html

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

Sidebar

Related Questions

I'm beginning python and I'm trying to use a two-dimensional list, that I initially
I've used python for a long time, and I'm just beginning to use C++
I use pylab (more specifically numpy) in all of my python programs­. The exceptions
I use the following at the beginning of all modules in my Python project:
When coding python, I use the logging module a lot. After some bad experiences
Since beginning to use VB.NET some years ago I have become slowly familiar with
I'm beginning to use the swtbot to test my reccent eclipse rcp projekt. A
I'm beginning to work on mailing-list software we use internally (EDIT: though we send
I have a button I want to use in the beginning and the end
I'm trying to use Python to concatenate a few javascript files together before minifying

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.