Python Forum
matplotlib.pyplot functions create new figures instead of applying to the current one
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
matplotlib.pyplot functions create new figures instead of applying to the current one
#1
I'm starting to learn matplotlib, following the pyplot tutorial, but something weird—I think—is happening in the very first part.

When I do this,

import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4])
plt.ylabel('some numbers')
plt.show()
plt.plot([1, 2, 3, 4]) creates the figure, but plt.ylabel('some numbers') creates another figure with the label but with no plot. Nothing about this is mentioned in the tutorial, and I have been reading about the plt functions to see if this is supposed to happen and/or how to fix it, but can't find anything. What can I do about this?

I just installed matplotlib 3.1.3 and I'm running Python 3.7.6 on Spyder 4.0.1

I see that, in this version of Spyder, I don't need to use plt.show(), because all figures are shown in the 'Plots' pane.

Thanks in advance.
Reply
#2
i have also problem drawing a plot from a csv file on jupyter notebook....how can i do it?
Reply
#3
(Jul-09-2020, 08:13 AM)Monira Wrote: i have also problem drawing a plot from a csv file on jupyter notebook....how can i do it?

Please create a new thread with your issue.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question I’m trying to create a Power BI Matplotlib quadrant chart and I’m a little stumped. Nidwolff 1 323 Mar-04-2024, 06:07 AM
Last Post: Danishhafeez
  matplotlib.pyplot issue lonaveia 2 2,314 Jul-28-2020, 02:40 PM
Last Post: hussainmujtaba
  Loss and Accuracy Figures. Hani 3 2,982 May-20-2020, 06:55 PM
Last Post: jefsummers
  How do I create these Kernel functions in Python for Gaussian Process Regression? Shivam18 0 2,161 May-20-2020, 03:04 PM
Last Post: Shivam18
  How does pyplot know what was plotted by the output of pandas.DataFrame(...).cumprod( codeowl 2 2,163 Mar-28-2020, 08:27 AM
Last Post: j.crater
  How to create matplotlib subplots from figures vitaly 3 3,082 Mar-02-2020, 12:58 AM
Last Post: scidam
  huge and weird values after applying some calculations karlito 2 2,126 Dec-13-2019, 08:32 AM
Last Post: karlito
  Applying operation to a pandas multi index dataframe subgroup Nuovoq 1 2,615 Sep-04-2019, 10:04 PM
Last Post: Nuovoq
  Superimpose figures Scientifix 2 4,624 Aug-16-2019, 04:06 PM
Last Post: Nitram
  zooming in pyplot window SchroedingersLion 0 2,170 Aug-02-2019, 02:59 PM
Last Post: SchroedingersLion

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020