Skip to content

Latest commit

 

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlotBB

Latest Release PyPi

GitHub issues Contributing

A Python package to be used in conjunction with Matplotlib to emulate the look of the Bloomberg charts, because not all of us have $31,980 to spare.

Examples

PlotBB.plot(x, y, fill="blue", bg="light_blue")

blue_bg_blue_example


PlotBB.plot(x, y, fill="orange", bg="light_blue")

orange_bg_blue_example


PlotBB.plot(x, y, fill="orange", bg="none")

orange_bg_none_example

Usage

Note

All functions like subplots() and PlotBB.plot() are wrappers for their Matplotlib respective underlying function and all *args and **kwargs are passed. This allows users to modify any styling or behavior.

Single plot setup:

from plotbb import PlotBB
import matplotlib as plt
import pandas as pd

chart_data = pd.read_csv("time_series_data.csv")

chart = PlotBB()
chart.plot(chart_data["Date"], chart_data["Price"])

plt.show()

Multiplot setup with subplots():

from plotbb import PlotBB, subplots
import matplotlib as plt
import pandas as pd

chart_data = pd.read_csv("time_series_data.csv")

fig, axes = subplots(
    nrows=3,
    ncols=1,
    figsize=(12, 8),
    sharex=True
)

chart1 = PlotBB(axis=axes[0])
chart1.plot(chart_data["Date"], chart_data["Price"])

plt.show()

Warning

Ensure plotbb.subplots() is used and NOT matplotlib.pyplot.subplots(). Also ensure the correct Axes is used. This allows PlotBB to style the Matplotlib correctly and draw on the correct subplot.

Different plot styles:

from plotbb import PlotBB, subplots
import matplotlib as plt
import pandas as pd

chart_data = pd.read_csv("time_series_data.csv")

fig, axes = subplots(
    nrows=3,
    ncols=1,
    figsize=(12, 8),
    sharex=True
)

chart1 = PlotBB(axis=axes[0])
chart1.plot(chart_data["Date"], chart_data["Price"], fill="orange", bg="none")

plt.show()

Saving figures

from plotbb import PlotBB
import matplotlib as plt
import pandas as pd

chart_data = pd.read_csv("time_series_data.csv")

chart = PlotBB()
chart.plot(chart_data["Date"], chart_data["Price"])

chart.figure.savefig("chart.png")

Contributing

Feel free to contribute by either giving more references of the Terminal charts (as I don't have access to the actual terminal and am limited to photos from Google), submitting issues on the repository's page, or forking and creating pull requests. Any help is appreciated!

Disclaimers

This service has been developed independently from and is not endorsed by the Bloomberg L.P. "Bloomberg" and "Bloomberg Terminal" are trademarks and service marks of Bloomberg Finance L.P., a Delaware limited partnership, or its subsidiaries.

About

Bloomberg Charts styled plots and plotting helpers for Matplotlib

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages