Python Forum
saving only one line of a figure as an image (python matplotlib)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
saving only one line of a figure as an image (python matplotlib)
#1
hello i have been trying to find a way to save a single line of my plot to save them one-by-one separately in the docs but i wasn't able to find anything of the sort is it possible to do that with something that resembles this? :
import numpy as np
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig .add_subplot(111)
line1 = ax.plot(x1,y1)
line2 = ax.plot(x2,y2)
fig.savefig(ax(line1),"img.png")
or similar
thanks in advance Heart
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Saving progress in a Python program to use later Led_Zeppelin 9 2,157 Sep-11-2022, 01:32 PM
Last Post: snippsat
  Graphic line plot with matplotlib, text file in pytho khadija 2 1,375 Aug-15-2022, 12:00 PM
Last Post: khadija
  matplotlib Plotting smooth line with nans mikisDeWitte 4 3,101 Mar-11-2022, 02:40 PM
Last Post: mikisDeWitte
  Upload image to Instagram using python/selenium using image URL failed, need help greenpine 5 5,448 Feb-22-2022, 09:42 PM
Last Post: snippsat
  saving and loading text from the clipboard with python program MaartenRo 2 1,655 Jan-22-2022, 05:04 AM
Last Post: MaartenRo
  multi-line CMD in one-line python kucingkembar 5 3,953 Jan-01-2022, 12:45 PM
Last Post: kucingkembar
  plot on the same figure using a for loo with matplotlib drSlump 2 1,707 Oct-13-2021, 07:11 AM
Last Post: drSlump
  matplotlib, no plot when using Figure ajvperth 2 1,674 Oct-12-2021, 02:29 PM
Last Post: ajvperth
  Showing and saving the output of a python file run through bash Rim 3 2,426 Oct-06-2021, 10:48 AM
Last Post: gerpark
  Matplotlib: How do I convert Dates from Excel to use in Matplotlib JaneTan 1 3,220 Mar-11-2021, 10:52 AM
Last Post: buran

Forum Jump:

User Panel Messages

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