|
From: gsal <sal...@gm...> - 2013-01-04 21:22:45
|
can you provide an example? The reference help is only two lines! Given: [code] import numpy as np import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.broken_barh([ (110, 30), (150, 10) ] , (10, 9), facecolors='b', label='barh') ax.set_xlim((0,200)) ax.set_ylim((0,50)) ax.legend() plt.show() [/code] How do I import what in order to, say, create a plot "plot([0.0],[0.0],'bs')" so that I can at least plot a marker of the same color as my broken_barh so that when the legend is added, the correct icon precedes the label? I tried adding pp = plt.plot([80],[40],'bs', label='proxy artist') to the previous program, right before the legend command, but it actually plots the marker, too. Is there a way to import "plot" or "Line2D" or something so that I can produce an artist that is NOT related to the plot and, hence, not plotted? (is that what "proxy artist" means?). -- View this message in context: http://matplotlib.1069221.n5.nabble.com/legend-on-a-plot-with-broken-barh-tp40145p40149.html Sent from the matplotlib - users mailing list archive at Nabble.com. |