python - How to change x axis increments and plot using log(x) on the xaxis? -
i shorten xaxis data more visible. however, don't know how accomplish while leaving xaxis log(x).
here code above image:
data = data([ bar( y=[x/float(114767406) x in yp_views], x=[x x in yp_views], name='relative frequency')]) layout = layout(xaxis=xaxis(type='log',title = "number of premium highlight views") ,yaxis=yaxis(title = "frequency")) fig = figure(data = data, layout = layout) py.iplot(fig)
here tried:
i tried solving problem using histogram , xbins. however, doesn't allow me freedom of using custom x , y axis plot. don't see xbins property bar charts. there name it?
here trying plot using range:
data = data([ bar( y=[x/float(114767406) x in yp_views], x=[x x in yp_views], name='relative frequency')]) layout = layout(xaxis=xaxis(type='log', range = [3000,10000], title = "number of premium highlight views") ,yaxis=yaxis(title = "frequency")) fig = figure(data = data, layout = layout) py.iplot(fig)
you can use range=[min, max]
in xaxis
/ yaxix
define desired range. example, layout
this:
layout = layout(xaxis=xaxis(type='log', range=[np.log10(3000), np.log10(10000)], title = "number of premium highlight views"), yaxis=yaxis(title = "frequency"))
Comments
Post a Comment