matplotlib / matplotlib/mplfinance

Multiple candles on same plot

Open
#322 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement question
Dominant language
Python
Stars
4.4k
Forks
678
PR merge metrics
No merged PRs in 30d

Description

Hi,

I appreciate your work!
How would I plot multiple candles together side by side on the same figure?
I want to compare 1. original data, 2. modified data side by side.
So for each x value there will be 2 candles.

My first attempt was scale the width and maybe offset each candle to the side. But I could not find any option to do that.
![Selection_006](https://user-images.githubusercontent.com/34349131/105670801-f6435000-5f24-11eb-9eaa-c6aa10a8729b.png)

It would be nice to have horizontal_offset keyword to place candles offset from the centre. Is what I want to achieve possible?
Hopefully I want to achieve the same with volume plot too.
If it is not possible, how about having two separate scale width for each? The candles will still be overlapped but at least they can be distinguished.

`plot2 = fplt.make_addplot(data2,type='candle')`
`fplt.plot(data, type='candle', style=s, volume=True, addplot=plot2, scale_width_adjustment=dict(candle=0.5))`

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the fplt.make_addplot and fplt.plot calls shown in the issue, then trace how candle addplots and scale_width_adjustment are handled. Define and implement a supported way to display original and modified candles side by side, including the requested volume behavior, and verify that both datasets are visibly distinguishable.

Written by the indexing model from the issue text.

Assessment

Tech stack
matplotlib, python
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.