While using the legends module for matplotlib is fine for labeling my plots distinguishably, I want to label my plots using a color labeling like (without the lines):
If I where to go about this with my plot, I use the text module to put in the labels with the same color. For example, from my plot:
fig6 = plt.figure()
VelCumullog = fig6.add_subplot(111)
VelCumullog.plot(VelCumu[0], VelCumu[1], color = 'slateblue', label = 'Illustris-1')
VelCumullog.plot(VelCumuD[0], VelCumuD[1], color = 'crimson', label = 'Illustris-1-Dark')
VelCumullog.set_xscale('log')
VelCumullog.set_yscale('log')
VelCumullog.set_xlim(50,500)
VelCumullog.set_ylim(1,5000)
VelCumullog.set_xlabel('$\mathrm{Velocity\ Relative\ to\ Host}\ [\mathrm{km}\ \mathrm{s}^{-1}]$')
VelCumullog.set_ylabel('$N\ (>v_{\mathrm{rel}})$ ', labelpad=-1)
VelCumullog.set_xticks([100, 1000])
VelCumullog.set_yticks([10, 100, 1000])
VelCumullog.get_xaxis().set_major_formatter(tic.ScalarFormatter())
VelCumullog.get_yaxis().set_major_formatter(tic.ScalarFormatter())
#VelCumullog.legend(loc='upper left', frameon=False)
VelCumullog.text(60, 2800, 'Illustris-1', color='slateblue')
VelCumullog.text(60, 1800, 'Illustris-1-Dark', color='crimson')
Where you see me just use text instead of legend.
But as you see, if I where to do this method for other plots, it can get pretty tedious to porperly place the labels on the plot, since I have to define their coordinates. Especially if the spacing between the text are off in comparison to the other texts in plots.
I was wondering if their would be another method in what I am wanting to do, like using the legends module, or something else that makes my life easier.


