I am very new to Python and I am having difficulties plotting a graph from a python code I wrote to an Excel Spreadsheet. The graph(s) are quite cluttered when using plt.show and I can't zoom in or manipulate the graph visually to see the plotted data clearly.
I've done some research on how to do it but so far, I've only managed to save the data onto a PNG File or an Excel File which saves the data as only a picture.
This is an example of the cluttered data, in the PNG Format:
Without cluttering the post with the entire code, here are the relevant bits to give some more detail:
from __future__ import division
import openpyxl as opxl
import numpy as np
import matplotlib.pyplot as plt
np.set_printoptions(threshold=np.nan)
import numpy as np
#Graphs
length1 = np.linspace(0,len(DI_plus),len(DI_plus))
length2 = np.linspace(0,len(DI_minus),len(DI_minus))
length3 = np.linspace(0,len(ADX),len(ADX))
length4 = np.linspace(0,len(ADXR),len(ADXR))
plt.figure(1)
plt.plot(length1 , DI_plus , label = 'DI_plus')
plt.plot(length2 , DI_minus, label = 'DI_minus')
plt.plot(length3+13, ADX , label = 'ADX')
plt.plot(length4+27, ADXR , label = 'ADXR')
plt.legend(bbox_to_anchor=(0., 1.02, 1., .102), loc=3, ncol=2, mode="expand",
borderaxespad=0.)
plt.ylabel('DMI Indicator Values')
plt.xlabel('Time period')
plt.show
plt.savefig('Workbook1.png')
plt.figure(2)
plt.plot(close[0:])
plt.show
This is my first post so please let me know if there is any more detail I can provide to help with my request. I tried finding my issue beforehand and I found this but I can't quite make it work.
Thank you very much!