How can I record the X Y limits of a displayed X Y plot using the matplotlib show module

+2 votes
I have routine that makes X,Y plots and I use show() to reformat the plot and use an interactive cursor. However, I am unable to access information after using show() about, for example, the X and Y limits I used in my final version. There are a lot of things I would like to understand about show(). Is there a good source of general information on how to use show()?
Dec 25, 2018 in Python by anonymous
295 views
Are you running the script on ipython with pylab mode or in non-interactive mode?

matplotlib.pyplot.show(*args**kw)

The show module when running in ipython with its pylab mode, display all figures and return to the ipython prompt.

When you are using a non-interactive mode it will display all figures and block until the figures have been closed.

When you are using it in an interactive mode it will have no effect unless figures were created prior to a change from non-interactive to interactive mode.

1 answer to this question.

+1 vote
A couple hours after posting this question I found some info on interactive mode. I never appreciated that show() is of noninteractive mode (ipoff). I used plt.ipon to turn interactibve mode on and found that this performance is what I was after. I can record X,Y positions and keystroke values and pass them back. Todays project: how to query and adjust the values in the rcParams dictionary to learn (for instance) the X,Y virtaul limints for the axes used in the last viewing. Thanks for you interest.
answered Dec 27, 2018 by anonymous

Hey @anonymus, to change the default rc settings in python script, you need to know that all the rc values are stored in dictionary-like variables known as matplotlib.rcParams. This is the global package it can be modified like this:

mpl.rcParams['lines.linewidth'] = length
mpl.rcParams['lines.color'] = 'color' 
plt.plot(data)

Hope this helps.

Have you tried some script to do this?

Related Questions In Python

0 votes
1 answer

How do I create a star using the turtle module of python?

Hey @Jinu, Try something like this: import turtle star = ...READ MORE

answered Jun 22, 2019 in Python by Neha
783 views
0 votes
1 answer

How do I draw a hexagon using the turtle module of python?

Hey @Jinu, try this: import turtle polygon = ...READ MORE

answered Jun 23, 2019 in Python by Haseeb
5,017 views
+2 votes
2 answers

How can I plot a k-dsitance graph using python?

Hi there, instead of sklearn you could ...READ MORE

answered Apr 10, 2018 in Python by charlie_brown
• 7,780 points
3,480 views
+2 votes
2 answers

In a list of dictionaries, how can I find the minimum calue in a common dictionary field.

There are several options. Here is a ...READ MORE

answered Apr 10, 2018 in Python by charlie_brown
• 7,780 points
542 views
0 votes
2 answers

How can I get the count of a list in Python?

n=[1,2,3,4,5,6,7,8,9] print(len(n)) =9 READ MORE

answered Dec 10, 2020 in Python by anonymous
529 views
0 votes
1 answer

How can I lookup hostname using the IP address with a timeout in Python?

Good question. I actually was stuck with ...READ MORE

answered Feb 6, 2019 in Python by Nymeria
• 3,540 points
1,431 views
0 votes
1 answer
0 votes
1 answer

How can I find the square of a number in python?

You can use the exponentiation operator or ...READ MORE

answered May 21, 2019 in Python by Mohammad
• 3,230 points
294 views