hello all
how can i write a simple bar charts with bokeh?!-- output->(‘barchart.html’)
i can just write with matplotlib
thank
hello all
how can i write a simple bar charts with bokeh?!-- output->(‘barchart.html’)
i can just write with matplotlib
thank
Hi Alireza,
I’m not sure if I fully understand your need. TheBokeh documentation lists a couple of Bar chart examples (both outputs to static html files). You can find one in the tutorials that use bokeh.plotting interface here and another one using bokeh.charts here. Charts is still experimental so it’s API is likely to change in the next releases.
Cheers
Fabio
On Sat, Nov 15, 2014 at 7:08 AM, alireza shokrizade [email protected] wrote:
hello all
how can i write a simple bar charts with bokeh?!-- output->(‘barchart.html’)
i can just write with matplotlibthank
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/d722a940-8bf3-4235-ad3e-668fc867d81b%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
–
Fabio Pliger
Hi Fabio
this is my code. and i can run it but does not show chart in browser
import matplotlib.pyplot as plt
import numpy as np
from bokeh.plotting import *
from six.moves import zip
dict = {‘A’:34, ‘B’:48 , ‘C’:63, ‘D’:74, ‘E’:19, ‘F’:29}
for i , key in enumerate(dict):plt.bar(i,dict[key])
plt.xticks(np.arange(len(dict))+0.4, dict.keys())
plt.yticks(dict.values())
output_file(“histogram.html”, title=“histogram.py example”)
show()
thanks for your attention
On Mon, Nov 17, 2014 at 3:15 PM, Fabio Pliger [email protected] wrote:
Hi Alireza,
I’m not sure if I fully understand your need. TheBokeh documentation lists a couple of Bar chart examples (both outputs to static html files). You can find one in the tutorials that use bokeh.plotting interface here and another one using bokeh.charts here. Charts is still experimental so it’s API is likely to change in the next releases.
Cheers
Fabio
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CAPVmnqAFTZv478UeQawxMb_KaD%3DsSj56rpnu8pf%3DGAs7A5PXbw%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
On Sat, Nov 15, 2014 at 7:08 AM, alireza shokrizade [email protected] wrote:
hello all
how can i write a simple bar charts with bokeh?!-- output->(‘barchart.html’)
i can just write with matplotlibthank
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/d722a940-8bf3-4235-ad3e-668fc867d81b%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
–
Fabio Pliger
Hi Alireza,
If you need to convert a mpl plot to bokeh you need to use bokeh.mpl. Unfortunately it does not support matplotlib.pyplot.bar yet, so your example wouldn’t be converted anyway. My advice is that you use bokeh directly without invoking matplotlib. As I mentioned on the previous reply you can use both bokeh.plotting or bokeh.charts (please remember that bokeh.charts is still experimental so it’s API may change in the next versions). I really recomment you to take a look at the examples and the documentation.
Here’s a script using bokeh.charts that displays a minimal bar chart based on your example:
import bokeh.charts as bc
import pandas as pd
cats = [‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’]
values = [34, 48, 63, 74, 19, 29]
df = pd.DataFrame({“values”: values}, index=cats)
hist = bc.Bar(df, cats, filename=“bug_histogram.html”)
hist.title(“some_test”).width(400).height(350).legend(True).show()
P.S.: On your example you have:
dict = {‘A’:34, ‘B’:48 , ‘C’:63, ‘D’:74, ‘E’:19, ‘F’:29}
You should really avoid this as your “dict” variable is overriding a python built-in type and will generate many errors.
Cheers
Fabio
On Mon, Nov 17, 2014 at 3:52 PM, alireza shokrizade [email protected] wrote:
Hi Fabio
this is my code. and i can run it but does not show chart in browser
import matplotlib.pyplot as plt
import numpy as np
from bokeh.plotting import *
from six.moves import zipdict = {‘A’:34, ‘B’:48 , ‘C’:63, ‘D’:74, ‘E’:19, ‘F’:29}
for i , key in enumerate(dict):plt.bar(i,dict[key])
plt.xticks(np.arange(len(dict))+0.4, dict.keys())
plt.yticks(dict.values())
output_file(“histogram.html”, title=“histogram.py example”)show()
thanks for your attention
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CABaVFSXWbc%2By8xLAmU8k%2BgMjTKsig_n0w%2Bsg1%2Bd4GM_GVA3m4A%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
–
On Mon, Nov 17, 2014 at 3:15 PM, Fabio Pliger [email protected] wrote:
Hi Alireza,
I’m not sure if I fully understand your need. TheBokeh documentation lists a couple of Bar chart examples (both outputs to static html files). You can find one in the tutorials that use bokeh.plotting interface here and another one using bokeh.charts here. Charts is still experimental so it’s API is likely to change in the next releases.
Cheers
Fabio
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CAPVmnqAFTZv478UeQawxMb_KaD%3DsSj56rpnu8pf%3DGAs7A5PXbw%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
On Sat, Nov 15, 2014 at 7:08 AM, alireza shokrizade [email protected] wrote:
hello all
how can i write a simple bar charts with bokeh?!-- output->(‘barchart.html’)
i can just write with matplotlibthank
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/d722a940-8bf3-4235-ad3e-668fc867d81b%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
–
Fabio Pliger
Fabio Pliger
thank you for mention Fabio
On Mon, Nov 17, 2014 at 8:50 PM, Fabio Pliger [email protected] wrote:
Hi Alireza,
If you need to convert a mpl plot to bokeh you need to use bokeh.mpl. Unfortunately it does not support matplotlib.pyplot.bar yet, so your example wouldn’t be converted anyway. My advice is that you use bokeh directly without invoking matplotlib. As I mentioned on the previous reply you can use both bokeh.plotting or bokeh.charts (please remember that bokeh.charts is still experimental so it’s API may change in the next versions). I really recomment you to take a look at the examples and the documentation.
Here’s a script using bokeh.charts that displays a minimal bar chart based on your example:
import bokeh.charts as bc
import pandas as pd
cats = [‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’]
values = [34, 48, 63, 74, 19, 29]
df = pd.DataFrame({“values”: values}, index=cats)
hist = bc.Bar(df, cats, filename=“bug_histogram.html”)
hist.title(“some_test”).width(400).height(350).legend(True).show()
P.S.: On your example you have:
dict = {‘A’:34, ‘B’:48 , ‘C’:63, ‘D’:74, ‘E’:19, ‘F’:29}
You should really avoid this as your “dict” variable is overriding a python built-in type and will generate many errors.
Cheers
Fabio
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CAPVmnqANmGWc8T6bx-vSsYJk3%2BZZTX7Q%2BJLv6a_v7M7q001PtA%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
On Mon, Nov 17, 2014 at 3:52 PM, alireza shokrizade [email protected] wrote:
Hi Fabio
this is my code. and i can run it but does not show chart in browser
import matplotlib.pyplot as plt
import numpy as np
from bokeh.plotting import *
from six.moves import zipdict = {‘A’:34, ‘B’:48 , ‘C’:63, ‘D’:74, ‘E’:19, ‘F’:29}
for i , key in enumerate(dict):plt.bar(i,dict[key])
plt.xticks(np.arange(len(dict))+0.4, dict.keys())
plt.yticks(dict.values())
output_file(“histogram.html”, title=“histogram.py example”)show()
thanks for your attention
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CABaVFSXWbc%2By8xLAmU8k%2BgMjTKsig_n0w%2Bsg1%2Bd4GM_GVA3m4A%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
–
Fabio Pliger
On Mon, Nov 17, 2014 at 3:15 PM, Fabio Pliger [email protected] wrote:
Hi Alireza,
I’m not sure if I fully understand your need. TheBokeh documentation lists a couple of Bar chart examples (both outputs to static html files). You can find one in the tutorials that use bokeh.plotting interface here and another one using bokeh.charts here. Charts is still experimental so it’s API is likely to change in the next releases.
Cheers
Fabio
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CAPVmnqAFTZv478UeQawxMb_KaD%3DsSj56rpnu8pf%3DGAs7A5PXbw%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
On Sat, Nov 15, 2014 at 7:08 AM, alireza shokrizade [email protected] wrote:
hello all
how can i write a simple bar charts with bokeh?!-- output->(‘barchart.html’)
i can just write with matplotlibthank
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/d722a940-8bf3-4235-ad3e-668fc867d81b%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
–
Fabio Pliger