Andrea Mastrangelo
2014-10-05 14:46:54 UTC
I guys, i can't add a legend to a plot i'm saving
The plotting code is the one below:
plt.plot(x, y_1, 'b', x, y_2, 'r', x, y_3, 'g')
blue_patch = mpatches.Patch(color='blue',
label=self.y_ok[0])
red_patch = mpatches.Patch(color='red',
label=self.y_ok[1])
green_patch = mpatches.Patch(color='green',
label=self.y_ok[2])
plt.legend(handles=[blue_patch])
plt.xlabel(self.x_ok)
plt.ylabel(self.y_ok[0] + ' ' +self.y_ok[1] + ' ' +
self.y_ok[2])
plt.xlim((self.axisScale[0],self.axisScale[1]))
plt.ylim((self.axisScale[2],self.axisScale[3]))
I try to add the legend how you can see, but i get a warning message and
the figure saved hasn't got the legend
Could you help me?
The plotting code is the one below:
plt.plot(x, y_1, 'b', x, y_2, 'r', x, y_3, 'g')
blue_patch = mpatches.Patch(color='blue',
label=self.y_ok[0])
red_patch = mpatches.Patch(color='red',
label=self.y_ok[1])
green_patch = mpatches.Patch(color='green',
label=self.y_ok[2])
plt.legend(handles=[blue_patch])
plt.xlabel(self.x_ok)
plt.ylabel(self.y_ok[0] + ' ' +self.y_ok[1] + ' ' +
self.y_ok[2])
plt.xlim((self.axisScale[0],self.axisScale[1]))
plt.ylim((self.axisScale[2],self.axisScale[3]))
I try to add the legend how you can see, but i get a warning message and
the figure saved hasn't got the legend
Could you help me?
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.