Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Inserting a variable name into xlabel
#1
Hi, first post here.

I am trying to streamline a lot of data processing by using a class of objects called "image". I define each image as "image1 = image(...), image2 = ..." and so on.

class image(self, path):
...
image1 = image('pathway')
I am looking to plot data that can be distinguished from each image, but I can't seem to figure out how to insert a variable value that isn't a number. Would it look something close to this:

plt.xlabel("pixels (x), %" % self)
where self is the image name (ie image1, image2...)?

The errors that keep popping up only relate to the type of value it should be:
"must be real number, not image"

If I can't get a word in there, I can always just add an assigned number to the class values or whatever. But I would prefer the actual name for this.

Thank you!
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Reportlab: Add xlabel, ylabel and grid to lineplot denissanga 2 2,824 Dec-19-2017, 04:48 PM
Last Post: denissanga

Forum Jump:


Users browsing this thread: 1 Guest(s)