I tried to make an area chart with pandas-bokeh package using this code:
import pandas as pd
import numpy as np
import pandas_bokeh
df = pd.read_excel('D:/Coding Practice/data/data_corona_usa.xlsx')
df = df.iloc[::-1].reset_index()
df['Cummulative Cases'] = df['cases'].cumsum()
df['date'] = df['dateRep'].dt.strftime('%D')
#to make it appear in your notebook
pandas_bokeh.output_notebook()
df.plot_bokeh(
kind='area',
x= 'dateRep',
y='Cummulative Cases',
xlabel = 'Date',
ylabel = 'Cummulative Cases',
hovertool_string= r'''<h1> Date: @{date} </h1>
<h2> Cummulative Cases: @{Cummulative Cases} </h2>''',
title='US Corona Cases (cummulative)',
hovertool=True,
fontsize_title=18,
logy=True,
stacked=False,
legend='top_left'
)
But the resulting area chart is just like this image.
The chart do not cover the area below that unknown diagonal line. This result happens because of the code "logy = True" that make ytick uses logarithmic scale. If i delete this one line of code, the area chart would appear normal like this.
Even so, i want the area chart use logarithmic scale on y-axis. How can i fix it?
First of all you have to understand that you minimal example is not a working example. Your local path makes it very difficult to reproduce the behavior, because nobody is able to load the data like you do.
Second, I have to tell you, that your problem isn't solveable, if you want to use pandas-bokeh. This is because the area plot is initialized with zeros inside this module and if you use a logarithmic y axes zero doesn't exist. The reason is, that log(0) is not defined. What you can see is the default behavior.
If you are willing to switch to bokeh itself, you are welcome to follow this minimal example:
Some example data:
Now we want to reproduce your observation in plain bokeh.
If you set the baseline diffrent from zero, may like this
y2=[0.01]*df.shape[0]
you get want you are looking for.