Graphs use colormap defined in settings

This commit is contained in:
Jamie Cash
2021-06-02 17:49:54 +01:00
parent 1656c6a4d2
commit 06c980a45a
3 changed files with 9 additions and 3 deletions
@@ -22,8 +22,8 @@ class MDIChildCorrelationGraph(mdi.CorrelationMDIChild):
__tick_fmt_date = matplotlib.dates.DateFormatter('%d-%b')
__tick_fmt_time = matplotlib.dates.DateFormatter('%H:%M:%S')
# Colors for graph lines fro symbol1 and symbol2
__colours = ['green', 'blue']
# Colors for graph lines for symbol1 and symbol2. Will use first 2 colours in colormap
__colours = matplotlib.cm.get_cmap(cfg.Config().get("charts.colormap")).colors
# Fig, axes and canvas
__fig = None
@@ -1,9 +1,13 @@
import logging
import matplotlib.dates
import matplotlib.pylab as pl
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import numpy as mp
import numpy as np
import wx
import wx.lib.scrolledpanel as scrolled
import wxconfig as cfg
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
@@ -30,7 +34,7 @@ class MDIChildDivergedGraph(mdi.CorrelationMDIChild):
__fig = None
# Colors for graph lines
__colours = ['red', 'green', 'blue', 'pink', 'purple', 'black', 'yellow', 'lightblue']
__colours = matplotlib.cm.get_cmap(cfg.Config().get("charts.colormap")).colors
def __init__(self, parent, **kwargs):
# Super