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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:07:01+00:00 2026-06-18T00:07:01+00:00

I am trying to construct a plot where I have a fixed number of

  • 0

I am trying to construct a plot where I have a fixed number of rows but differing number of columns for each row. The code I use for plotting is equivalent to:

import matplotlib.pyplot as pl
pl.figure()
pl.ion()
pl.subplot(2,1,1)
pl.title("Sets the title for top plot")

plotData(data[0]) # Function that plots data in this first row

for i in range(3):
    pl.subplot(2,3,4+i)
    pl.title("Sets the title of each subplot in second row")
    plotData(data[i+1]) # Plots the data in second row

Now for some reason the data plotted in the subplots of the second row disappears. When I debug it it seems as it is there until returning from the plotData() function within the for-loop (or possibly upon calling
the next subplot command – but this does not explaing why the last subplot is empty …).

EDIT:

There was code at the end of the plotData() function that triggered the problem:

pl.gca().set_xlim(0,15)
pl.gca().set_ylim(0,15)

Does this mean that I can not set the x,y-limits after plotting the data, or what am I doing wrong here?

A pastebin of the minimal example showing the problem can be found here

  • 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-18T00:07:02+00:00Added an answer on June 18, 2026 at 12:07 am

    OK, that was embarrassing. If you take a look at the code on pastebin the problem was that the xlim and ylim that I was setting did not take into account the fact that I switched direction of the coordinate system (in y-direction). In plotData():

    for i,dset in enumerate(data):
        x = np.array([point['x'] for point in dset])
        y = np.array([-point['y'] for point in dset])
    

    My calls to set_xlim and set_ylim did exactly what they were supposed to, it was just that with the limits I set the data was no longer visible in these plots (since I switched the sign of the y-axis on the data but not on the limits).

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

Sidebar

Related Questions

I have 20 milliion rows in my table.I am trying to plot graph for
I have written the following code to plot a graph but it is not
Trying to construct a query such that I have multiple statement specifying joins, each
I am trying to construct a datagridview that will show a number of rows
I'm trying to plot real-time graph, with time axis, but I have found the
I am trying to construct a deeply nested associative array but i don't know
I'm trying to construct a datatype that is essentially a binary tree whose: each
I am trying to construct a TreeView from a Menu. My Code is like
I'm trying construct a PostgreSQL query that does the following but so far my
I am trying to construct a path for each image defined in images list

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.