You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importmatplotlib.pyplotasplt;
importnumpyasnpimportmatplotlib.pyplotaspltf=plt.figure(figsize=(12,4))
ax1=plt.subplot(131)
ax1.bar(range(len(a['max'])),a['max'],alpha=0.5,align="edge",tick_label=a['test'])
ax2=plt.subplot(132)
ax2.bar(range(len(a['max'])),np.exp(a['max']/10.0),alpha=0.5,align="center",tick_label=a['test'])
ax3=plt.subplot(133)
plt.yscale('log')
ax3.bar(range(len(a['max'])),np.exp(a['max']/10.0),alpha=0.5,align="center",tick_label=a['test'])
#ax3.set_xticklabels(a['test']) # interestingly if I use this then ticks are not centeredf.savefig('test.png')
fromIPython.displayimportImageImage('test.png')
Added to the list of all the deficiencies of the BarPlot implementation, I'll try to see if there's a quick fix but if not this won't get fixed until we rewrite BarPlot from scratch.
I'll give a partial update on the current state of the issue as of HoloViews 1.16.2, with bokeh backend.
Currently you will always get the warning "Logarithmic axis range encountered value less than or equal to zero, please supply explicit lower-bound to override default of 0.010" even if your data only include values > 0. Also the lower bound will be set to 0.01.
The issue lies with the fact that with a Bars element (and probably histogram), the low variable that is mentioned here is 0 whatever the data.
What's important here is that the bottom of the bars itself will be set at 0.01. And if you have a value lower than 0.01, the bar will go downward from 0.01:
It's a bit tricky to deal with bars on a logarithmic y-axis but I think that provided the element (here BarsPlot, which inherits its get_extents method from BarsMixin) returns the actual lower data from the data instead of 0, the issue will be fixed.
Here is the problem:
Here is the matplotlib code which works:
Is it me - or it's not possible?
P.S. More examples here
The text was updated successfully, but these errors were encountered: