deephaven / deephaven-core

Deephaven Community Core
Other
248 stars 79 forks source link

Plotting using mplfinance uses the default theme instead of our theme #2079

Open mofojed opened 2 years ago

mofojed commented 2 years ago

Description

A clear and concise description of what the bug is.

Steps to reproduce

  1. Start up a docker image with deephaven-plugin-matplotlib, mplfinance, and yfinance modules installed:
    FROM ghcr.io/deephaven/server:edge
    RUN pip install deephaven-plugin-matplotlib
    RUN pip install yfinance
    RUN pip install mplfinance
  2. Create an mplfinance plot:
    
    import matplotlib.pyplot as plt
    import pandas as pd
    import yfinance as yf
    import mplfinance as mpf

TICKER = "AAPL"

plt.figure() df = yf.download(TICKER, start="2020-07-01", end="2020-12-31", auto_adjust=True) mpf.plot(df["2020-12-01":]) f = plt.gcf()



**Expected results**

2. Plot appears with the theme we've defined

**Actual results**

2. Plot appears but with the default theme, sticking out like a sore thumb:
![image](https://user-images.githubusercontent.com/4505624/157480064-32439acc-6631-462d-b5db-f7a6c6bc1cd2.png)
mofojed commented 2 years ago

mplfinance has some additional theming specified, see examples: https://github.com/matplotlib/mplfinance/blob/master/examples/styles.ipynb

Not sure we can set this with just our deephaven-plugin-matplotlib or if we'd need a specific mplfinance one.