Jul-10-2017, 05:54 PM
(This post was last modified: Jul-10-2017, 06:20 PM by shaynehansen.)
I am trying to add text to my plots in the upper right of the plot. The issue is the plots vertical axis is constantly changing. Is there a way to lock the text to the same spot regardless of the axis change?
What I have been trying is shown below. The text(1., 1.) portion of the code will place text at that data location on the plot, instead of the upper right corner.
Sorry guys, found the mistake. Should have been using figtext(), instead of text().
What I have been trying is shown below. The text(1., 1.) portion of the code will place text at that data location on the plot, instead of the upper right corner.
with PdfPages('Data Comparison Ethan Text Files.pdf') as pdf: text_data_file = files._textfile_data(textfile1, textfile2, textfile3, textfile4, textfile5) current_key = iter(dictionary) n = dictionary._sample_size(key_filename) * dictionary._revolutions(etim_filename) for x in range(len(dictionary._key_data(key_filename))-1): plt.plot(range(0,n), dictionary[next(current_key)], linewidth = 0.25) plt.plot(range(0,n), text_data_file[:,x], ':', linewidth = 0.25) ei = sum(text_data_file[:,x]) - sum(dictionary[dictionary._key_data(key_filename)[x]]) MAE = abs(ei)/n plt.text(1., 1., 'MAE is: %s' %(MAE), fontsize = 'x-small')
Sorry guys, found the mistake. Should have been using figtext(), instead of text().