Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Matplotlib 1.43 to 1.5.2
#1
I have the following code which does not give me an error with Matplotlib 1.4.* but it does with Matplotlib 1.5 upwards:

    def set_line_properties(self, line, axes=None, figure=None, color='b', linewidth=1, linestyle='-', marker=None,
                            alpha=1., transform=None, row_index=0, picker=3):
        """sets various linestyle parameters for given line object"""
        line.set_axes(axes)
        line.set_figure(figure)
        line.set_c(color)
        line.set_lw(linewidth)
        line.set_ls(linestyle)
        if marker is not None:
            line.set_marker(marker)
        line.set_alpha(alpha)
        line.set_transform(transform)
        line.row_index = row_index
        line.set_picker(picker)
        return
I think especially the first two commands pose errors.
The error output is:
Quote:line 384, in set_line_properties
line.set_axes(axes)
AttributeError: 'Line2D' object has no attribute 'set_axes'
.
If i exclude this line the error message is the following:
Quote:line 385, in set_line_properties
line.set_figure(figure)
(...)
RuntimeError: Can not put single artist in more than one figure

Does anyone have an idea how i could fix this?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Matplotlib: How do I convert Dates from Excel to use in Matplotlib JaneTan 1 3,161 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