matplotlib / matplotlib/mplfinance

Chart customization when using Panels..

Open
#398 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi,
i have the following chart i build using the panels approach:
![image](https://user-images.githubusercontent.com/855627/118929281-4c903080-b912-11eb-9983-97b54bc10f1f.png)

I need to do some customization of this:
1. as you can see, i have the volume plotted as a series overlay on the main candle stick panel. I would like to add some opacity to the bar chart as well as have it displayed and scaled down to the lower 1/4th to 1/8th of the panel. Also, is there a concept of a z-order such that the candles are always on top of the bars and moving averages?
2. I would like to swap the y axis..such that volume is on the right and price on the left
3. You can see that because the volume is large for this data, it shows in exponential format...i would like to change and reduce the font to try and get it to display, or to have it scaled by 1/1000th perhaps.
4. there is a lot white space wasted on the chart borders, and im not sure how to control that. i tried adding the tight fit parameter, but it cuts off the right y-axis values. Is there a margin or padding that can help with this and how do you use with panels?
5. lastly, the separator line in between the panel does not appear for me as it does in the documentation..not sure why

I figure most of the above might be doable, and im just not familiar with the new panels api well enough...but having a hard time finding the docs. Can you point me to where the python docs are for the apis and the various input/parameters?

As an alternative, i tried doing tis by creating the individual figures and axis and passing those to mpl plot. However, when i try to create bar chart (which is needed for my histogram in the picture above), it fails. The line below returns a validation error complaining that 'bars' is not a valid type. when i look at the code, it does seem it is not a supported type for the plot function. is there a work around for this?

```
mpf.plot(s.data, ax = shared_axis, type = 'bars', color = s.color, ylabel='',
scale_width_adjustment=dict(lines=0.5),
update_width_config=wconfig)

```

Thanks much

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 panels API documentation and the shown mpf.plot(..., type='bars', ...) call; compare the requested panel, axis, scaling, spacing, separator, and bar-type behavior with the documented parameters. Reproduce the validation error and check the existing panel examples. Done means the supported behavior and any required documentation or changes are clearly defined and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.