# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
import mplfinance as mpf
import pandas as pd 

myData = pd.read_csv("issue77_eurusd.csv")
myData['Date and Time'] = pd.to_datetime(myData['Gmt time'],format='%d.%m.%Y %H:%M:%S.000')
myData.set_index('Date and Time', inplace=True)
myData = myData.iloc[-24:]


line = mpf.make_addplot(myData["High"],scatter=False) #No issues drawing a line
scatter = mpf.make_addplot(myData["High"],scatter=True,secondary_y=False) #Issues drawing scatter

mpf.plot(myData,
         type = 'candle',
         style='yahoo', 
         addplot= line,
         figscale=1.8)
# -

print(pd.__version__)
print(mpf.__version__)

myData.describe()

import numpy as np

#scatter['data'].iloc[ 0] = np.nan
#scatter['data'].iloc[10] = np.nan
#scatter['data'].iloc[-1] = np.nan
scatter['data']

mpf.plot(myData,
         type = 'candle',
         style='yahoo', 
         addplot= scatter,
        )
mpf.plot(myData,
         type = 'candle',
         style='yahoo', 
         addplot= scatter,
         set_ylim=(1.1271,1.1286)
        )

mpf.plot(myData,
         type = 'candle',
         style='yahoo', 
         addplot= scatter,
         volume=True
        )
mpf.plot(myData,
         type = 'candle',
         style='yahoo', 
         addplot= scatter,
         volume=True,
         set_ylim=(1.1271,1.1286),
         set_ylim_panelB=(-0.005,0.006),
        )

scatter

myData.index.values

myData['High'].values

# #%matplotlib qt
# %matplotlib inline
import matplotlib.pyplot as plt


# +
def makeplot():
    fig = plt.figure()
    ax = fig.add_axes([0.0, 0.0, 1.0, 1.0])
    #ax.autoscale(enable=False,axis='y')
    ax.scatter(myData.index.values,myData['High'].values)
    
def makeplot_noas():
    fig = plt.figure()
    ax = fig.add_axes([0.0, 0.0, 1.0, 1.0])
    #ax.autoscale(enable=False,axis='y')
    miny = 1.1274 
    maxy = 1.1285
    ax.set_ylim(ymin=miny,ymax=maxy)
    minx = min(myData.index.values)
    maxx = max(myData.index.values)
    ax.set_xlim(xmin=minx,xmax=maxx)
    ax.scatter(myData.index.values,myData['High'].values)


# -

makeplot()

makeplot_noas()



StarcoderdataJupyterScriptsDedupFiltered