Skip to content

Plotting Too Much Data

Daniel Goldfarb edited this page Mar 5, 2021 · 41 revisions

Contents:


Plotting Too Much Data

  • Sometimes, without realizing it, users plot so much data that it becomes impossible to see the detailed shapes of candles or ohlc-bars.
  • In such a case, it's easy to think that you have a line plot instead of candles, as shown below:


How many candles are too many to see?

  • How many is "Too Many" depends primarily on the size of your plot, and on the resolution of your monitor (or printer).
  • The Above image shows 500 candles.
  • Below is the exact same 500 candle plot made full screen on a 27 inch monitor with basic HD (1920 x 1080) resolution.
  • Notice that now, at full screen, you can somewhat make out the appearance of candles:
    • (You may need to right-click and choose "Open image in new tab" to see the candle details.)


Is there something wrong with Mplfinance?

No. The limitations on being able to see candle detail for many candles at once, are due primarily to two things:

  • the limitations of human eyesight.
  • the limitations of computer monitors (and printers).

The limitations of human eyesight

  • Consider plotting intraday candles at 1 minute intervals. One full week of trading, 5 trading days, 6.5 hours each day, so that's 1950 candles.
  • A typical 27 inch (diagonal) computer monitor is 23.5 inches wide. 1950 candles full screen, and let's assume a space of 1/5 of a candle between each candle (so they aren't touching each other). Each candle will be less than 0.26 millimeters.
  • The smallest object the human eye can see is about 0.1 millimeter at a distance of 18 inches from the object.
  • You will see a 0.26mm candle, but you would be hard pressed to make out any details (such as distinguishing the wick from the candle itself). The 1/5 candle-width space between each candle is actuall too small to see; the candles will appear touching, making it difficult to distingish one candle from the next. The space would have to be more like 2/5 the width of a candle, leaving less of the 23.5 inches for candles, so each candle would then be only about 0.22 millimeters wide.
  • Bottom line: you are not going to be able to see details on that many candles, unless you use a much larger monitor, say 120 inch (diagonal) flat screen TV, the width of which is about 83 inches, making each candle about 0.9 millimeters.

The limitations of computer monitors (and printers).

  • All of the above assumes your monitor has more than enough resolution to draw the candles. We will discuss monitors, but the same principles apply to printers (except printer resolution is measured in dpi whereas monitors speak of pixels).
  • A Full High Definition (FHD) monitor is 1920 x 1080 pixels. No matter how large the monitor is, there will be less than 1 pixel to display the width of a candle (and it's wick). Such a monitor simply cannot draw 1950 candles.
  • 4K UHD (Ultra High Definition) is 3840 x 2160 gives 1.64 pixels per candle (if 1/5 candle space between each). Still cannot draw 1950 candles.
  • 8K UHD is 7680 x 4320 gives 3.28 pixels per candle. Each candle will be 3 pixels wide, and the wick 1 pixel wide, no matter how big the screen.

What Can We Do About Plotting So Much Data?

  • There are several things that can be done about plotting a large amount of data, and which one you choose depends partly on what your goals are. Here are some of the choices:

    • use type=line
    • plot less data
    • interactive zoom
    • resample data
  • The Images Below show 2000 rows of ohlc data, first as type='candle' and then as type='line'.

    • When taking such a "big picture view" of your data, perhaps a line chart is adquate:

  • Ask yourself, if you want to take a "big picture view" of your data (in this case over 7 years worth), ask yourself if seeing the individual one day at a time candle patterns will really make a difference to you. The question applies to viewing say 1 week of 1 minute candles (also approximately 2000 data points). Perhaps if looking at 7 years of trading, then weekly (instead of daily) candles are more appropriate. Or for 5 days of intraday trading, perhaps 5 minute (instead of 1 minute) intervals are just as useful for that long of a stretch of time.

If not, then perhaps use a line chart. If yes, then consider resampling your data, so that each candle represents, not one day, but one week, or one month, etc.