예제 #1
0
    def testCatPiePlotTroubles(self):

        val = [20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 40, 50, 60]
        cat = [
            "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
            "n"
        ]
        fig = Plot.piePlot("pp2", cat, val)
        del fig
예제 #2
0
cp = plt.catPlot("S1", t, "X", "Y").lineColor("black").show()
cp2 = plt.catPlot("S1", t, "X",
                  "Y").plotStyle("bar").gradientVisible(True).show()
cp3 = plt.catPlot(
    "S1", t, "X",
    "Y").plotStyle("scatter").pointColor("black").pointSize(2).show()
cp4 = plt.catPlot("S1", t, "X",
                  "Y").plotStyle("area").seriesColor("red").show()

cp = plt.catPlot3d("S1", t, "X", "X", "Y").show()

cpBy = plt.catPlotBy("S1", t, "X", "Y", "USym").show()

cpBy = plt.catPlot3dBy("S1", t, "X", "X", "Y", "USym").show()

pp = plt.piePlot("S1", t, "X", "Y")

chp = plt.catHistPlot("S1", t, "X").show()

hp = plt.histPlot("S1", t, "X", 5).show()
hp = plt.histPlot("S1", t, "X", 0, 10, 5).show()

ep = plt.errorBarXY("S1", t, "X", "XLow", "XHigh", "Y", "YLow", "YHigh").show()
epBy = plt.errorBarXYBy("S1", t, "X", "XLow", "XHigh", "Y", "YLow", "YHigh",
                        "USym").show()
ep2 = plt.errorBarX("S1", t, "X", "XLow", "XHigh", "Y").show()
epBy2 = plt.errorBarXBy("S1", t, "X", "XLow", "XHigh", "Y", "USym").show()
ep3 = plt.errorBarY("S1", t, "X", "Y", "YLow", "YHigh").show()
epBy3 = plt.errorBarYBy("S1", t, "X", "Y", "YLow", "YHigh", "USym").show()

doubles = [3, 4, 3, 5, 4, 5]
예제 #3
0
     .view("Sym", "Last", "Size", "ExchangeTimestamp")

catHistTradesBySym = Plot.catHistPlot("Number of Trades", tHist, "Sym")\
     .chartTitle("Trades per Symbol")\
     .show()

#  ************* PIE PLOTTING *************

tPie = db.t("LearnDeephaven", "StockTrades")\
     .where("Date=`2017-08-25`")\
     .view("Sym", "Last", "Size", "ExchangeTimestamp")

totalShares = tPie.view("Sym", "SharesTraded=Size").sumBy("Sym")

pieChart = Plot.piePlot("Shares Traded", totalShares, "Sym", "SharesTraded")\
     .chartTitle("Total Shares")\
     .show()

#  ************* OPEN HIGH LOW CLOSE (OHLC) PLOTTING *************

#  OPEN HIGH LOW CLOSE (OHLC) - SINGLE SERIES

tOHLC = db.t("LearnDeephaven","EODTrades")\
     .where("Ticker=`AAPL`", "ImportDate=`2017-11-01`",
            "inRange(EODTimestamp, '2017-06-01T12:00 NY', '2017-07-31T12:00 NY')")

plotOHLC = Plot.ohlcPlot("AAPL", tOHLC, "EODTimestamp", "Open", "High", "Low", "Close")\
     .xBusinessTime()\
     .lineStyle(Plot.lineStyle(2))\
     .chartTitle("AAPL OHLC - June-July 2017")\
     .show()