-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Playground for matplotlib/mplfinance#661
- Loading branch information
Showing
6 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
1-without-liberation-fonts/* | ||
2-with-liberation-fonts/* | ||
|
||
!.keep |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
setup: | ||
pip install mplfinance pyarrow # install pyarrow only to get rid of pandas warning | ||
|
||
test: | ||
sudo apt remove -y fonts-liberation | ||
rm -f ~/.cache/matplotlib/fontlist-v330.json | ||
FILE=1-without-liberation-fonts/image.png python script.py 2> 1-without-liberation-fonts/mpl-debug-logs.txt | ||
|
||
sudo apt update | ||
sudo apt install fonts-liberation | ||
rm -f ~/.cache/matplotlib/fontlist-v330.json | ||
FILE=2-with-liberation-fonts/image.png python script.py 2> 2-with-liberation-fonts/mpl-debug-logs.txt | ||
|
||
echo && md5sum 1-without-liberation-fonts/image.png 2-with-liberation-fonts/image.png && echo | ||
echo && tail -n 1 1-without-liberation-fonts/mpl-debug-logs.txt 2-with-liberation-fonts/mpl-debug-logs.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
# mplfinance | ||
For matplotlib/mplfinance#661 | ||
1. Run `make setup` - installs the latest `mplfinance` | ||
|
||
2. Run `make test`: | ||
|
||
- remove fonts-liberation if installed | ||
- renders the simplest chart | ||
- installs fonts-liberation | ||
- renders the chart again | ||
- prints MD5 sums of the images | ||
- prints the last lines of the `matplotlib` debug logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import os | ||
|
||
import matplotlib.pyplot as plt | ||
import pandas as pd | ||
|
||
import mplfinance as mpf | ||
|
||
plt.set_loglevel("debug") | ||
|
||
window = pd.DataFrame( | ||
[ | ||
[2.00, 4.00, 1.00, 3.00], | ||
], | ||
columns=["open", "high", "low", "close"], | ||
) | ||
|
||
window.index = pd.date_range("2022-01-01", periods=len(window), freq="D") | ||
|
||
mpf.plot(window, type="candle", savefig=os.environ["FILE"]) |