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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:01:41+00:00 2026-05-24T14:01:41+00:00

I’m using matplotlib in my wx.Frame to draw some arrows and text at a

  • 0

I’m using matplotlib in my wx.Frame to draw some arrows and text at a certain position. The number and position of the arrows is based on previously created data.
I do some calculations but basically it’s like this:

arrow = primer
for each primer:
draw one arrow at position y – 0.05 to the previos arrow (primer_y – 0.05).
The x position of the arrow comes from the data, which is calculated and scaled (not so important know, it’s just to now where the arrow should be at primer_x).

Everything works fine until I have many arrows to draw. E.g. in my code example the data contain 62 arrows, where 18 are drawn correctly, the next 3 are missing but the text is there and the rest is completly missing.

Does anyone knows what could be the problem? I tried allready to change the FigureSize but it’s only stretch the arrows.

Here’s a quick and dirty working example, data is included in the code:
http://pastebin.com/7mQmZm2c

Any help is highly appreciated!
Thanks in advance!
Stefanie

  • 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-05-24T14:01:43+00:00Added an answer on May 24, 2026 at 2:01 pm
    1. Stick

              print((primer_x+0.06, primer_y))
      

      inside the loop. You’ll find that the arrows cease to be drawn when
      primer_y becomes negative.

    2. Don’t draw the arrows with self.axes.annotate while labeling the
      arrow with self.fig.text. The axis and the figure use different
      coordinate systems. Changing self.fig.text to self.axes.text
      will allow you to use the same coordinate system, which will make it
      easier for you to position the text under the arrows.
    3. There are far too many
      hard-coded numbers (“magic numbers”) in your code. It makes it very
      hard to fix because when one number changes, the rest to do not change
      in a logical way along with it. If you can use formulas to define
      the relationship between some of those magic numbers, your life will
      be a lot easier.
    4. For example, if you change the for-loop to

      for primer,primer_y in zip(data,np.linspace(0.95,0.0,len(data))):
      

      instead of decrementing primer_y by a fixed amount with each pass through the loop, then primer_y will automatically space itself between 0.95 down to 0.0 no matter how many items there are in data.

    5. If you find the arrows are squished (vertically), you can expand the
      figure by changing the figsize on this line:

      self.fig = matplotlib.figure.Figure(figsize=(20, 30), facecolor='white')
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I want to construct a data frame in an Rcpp function, but when I
I have some data like this: 1 2 3 4 5 9 2 6
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have just tried to save a simple *.rtf file with some websites and
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build

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.