I am using mplfinance package to plot candlestick charts of the stock. I am currently trying to figure out how can I change the formatting of the volume in the mplfinance. In all examples provided by the package, and in my own chart the volume comes out in strange notation like 1e23 etc. I would like my volume to reflect the numerical value of what is actually in the pandas dataframe. I trade myself and when I am looking at charts anywhere on the actual trading platforms, it shows normal, it actually shows the volume. But when I look at matplotlib, pandas, mplfinance examples online, the notations is formatted in a strange way everywhere.
How can I change the formatting of the mplfinance volume on the chart?
2.2k views Asked by Biatrixia155 At
2
There are 2 answers
0
Daniel Goldfarb
On
Alternatively, to show the volumes not in scientific notation, but keeping the original values (not scaled down) ... using the same data/code as in the answer from @r-beginners ...
fig, axlist = mpf.plot(daily,type='candle',volume=True,
title='\nS&P 500, Nov 2019',
ylabel='OHLC Candles',
ylabel_lower='Shares\nTraded',
returnfig=True)
import matplotlib.ticker as mticker
axlist[2].yaxis.set_major_formatter(mticker.FormatStrFormatter('%d'))
mpf.show()
In theory it would be relatively easy to enhance mplfinance to accept a kwarg for formating the axis labels; but for now the above will work.
Related Questions in PYTHON
- How to store a date/time in sqlite (or something similar to a date)
- Instagrapi recently showing HTTPError and UnknownError
- How to Retrieve Data from an MySQL Database and Display it in a GUI?
- How to create a regular expression to partition a string that terminates in either ": 45" or ",", without the ": "
- Python Geopandas unable to convert latitude longitude to points
- Influence of Unused FFN on Model Accuracy in PyTorch
- Seeking Python Libraries for Removing Extraneous Characters and Spaces in Text
- Writes to child subprocess.Popen.stdin don't work from within process group?
- Conda has two different python binarys (python and python3) with the same version for a single environment. Why?
- Problem with add new attribute in table with BOTO3 on python
- Can't install packages in python conda environment
- Setting diagonal of a matrix to zero
- List of numbers converted to list of strings to iterate over it. But receiving TypeError messages
- Basic Python Question: Shortening If Statements
- Python and regex, can't understand why some words are left out of the match
Related Questions in MATPLOTLIB
- Str object is not callable in pandas
- How to throw a charged particle in a electric vector field?
- How are negative errorbar bounds transformed, when log axis scaling is applied before constructing a Seaborn lineplot?
- The kernel appears to have died. It will restart automatically. whenever i try to run the plt.imshow() and plt.show() function in jupyter notebook
- OpenGL Error [Python [OpenGL] [OpenAI Gym]
- Remove gaps between subplots_mosaic in matplotlib
- Matplotlib Fails to Update Axis Limits with ipywidgets in Jupyter Lab
- Low efficiency when plotting a large amount of contours on a single axis in python with matplotlib
- Why is countplot showing single value
- Matplotlib: Legend for marker and color in a scatterplot
- Contour plot projection not showing properly in matplotlib 3d plotting
- matplotlib sort barh by values
- loading variables from a python script in matlab
- cmap and color bar being compressed from the assigned range
- How can I position a pie chart within another plot according to x, y coordinates?
Related Questions in FINANCE
- Can't figure out to properly implement formula to get monthly payment for a mortgage into C#
- React component to display crypto price live data
- Is here a database for fetching a financial data for capital market?
- RSI from Trading View is different from my RSI calculation
- Proper way to implement transactional HOTP?
- Is there an Excel function to calculate the future value of constant interest rate, variable payments?
- Discrepancy between quantmod Results in R and Online Graphs with EURUSD load with yahoo
- How to configure Cumulative Dividend Reinvestment with an initial Value
- Rstudio monthly discount factor interpolation for data table
- Yield curve by liquidity premium hypothesis
- cs50 :( buy handles valid purchase expected to find "112.00" in page, but it wasn't found
- Goal Seek-Macro keeps crashing/running slow
- CRSP/Compustat Merged Database (CCM) in WRDS via Python didn't work
- How to decrease running time for a IRFunctionCurve.fitSvensson in Matlab?
- How to perform arithmetic operations from formula stored in another table in sql / pgsql?
Related Questions in MPLFINANCE
- Cannot draw a candlestick chart
- Plotted candlestick chart disappears after plotting additional data
- mplfinance : i dont want it to show date
- show_nontrading=False in mplfinance ruins my chart [EDITED
- TypeError occurs when plotting timezone-aware datetimes, loaded via pd.read_csv, with mpf.plot
- Datetime to matplotlib dates conversion leads to incorrect candlestick chart
- Does mplfinance support multiple figures
- x-axis shows 1970 as the starting year of time series dates
- How do I add a Moving Average line on top of a candlestick chart in subplots?
- Lots of horizontal lines in mplfinance
- set grid intervals for x and y axis in mplfinance
- EMA lines not with the rest of the graph
- mplfinance: 'secondary_y=True' not working. Not plot multiple lines/candles due to very wide Y-Axis data ranges
- Plotting issue with resistance, support bands and pivot points on trading data
- mplfinance TypeError: Expect data.index as DatetimeIndex
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)

The volume notation is automatically in exponential form based on the size of the volume, so if you want to avoid this, you can avoid it by making the original data smaller with unit data. The following example shows how to deal with this problem by dividing by 1 million. This data is taken from the official website.
This is how we responded.
Example of normal output