Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Pav A
@rs2
@TomAugspurger what's the suggested method for selecting a given backend? pandas options, a kwarg, etc?
Tom Augspurger
@TomAugspurger
ATM, on https://github.com/pandas-dev/pandas/compare/master...TomAugspurger:plotting-plugin, it’d be subclassing SeriesPlotMethods or FramePlotMethods
Pav A
@rs2
I.e. plot_frame(my_df, ..., backend='bokeh') or something else?
Pav A
@rs2
Looking...
Florian Rathgeber
@kynan
@TomAugspurger recommendation is still to branch off your branch, right?
Tom Augspurger
@TomAugspurger
I suppose, with the caveat that that is going to change
Florian Rathgeber
@kynan
that's expected, yes :)
Tom Augspurger
@TomAugspurger
Tom Caswell had good comments at https://github.com/pandas-dev/pandas/issues/14130#issuecomment-335690279 that I haven’t addressed yet
Pav A
@rs2
Cool, so you add to global engines something that can plot a DataFrame or a Series...
Tom Augspurger
@TomAugspurger
Yes. And changing the option plotting.engine will swap out the implemenation of DataFrame.plot with the value in that engines dictionary
which is an instance of *PlotMethods that knows how to plot things.
Jose Rivera-Rubio
@jmrr
git remote add toms git@github.com:TomAugspurger/pandas.git
git fetch toms
Pav A
@rs2
Ok, let's start with Series? Clone MPLSeriesPlotMethods(base.SeriesPlotMethods)
Jose Rivera-Rubio
@jmrr
and then the branch is plotting-plugin
Pav A
@rs2
Both bokeh and matplotlib require standalone/notebook/zeppelin-specific registration, e.g. output_notebook(hide_banner=True). Should that be done for all backends at registration? It's not a zero-cost operation for bokeh.
?
Pav A
@rs2
@TomAugspurger The Dispatcher APi on your branch does not work for Series, switching to frame for now :)
Tom Augspurger
@TomAugspurger
Thanks and sorry. There are zero tests for it :)
Pav A
@rs2
That's OK, that means we are invoking the right things, and are on the right path :smile:
Pav A
@rs2
s.plot._constructor says pandas.plotting.base.SeriesPlotMethods, whereas df.plot._constructor says pandas.plotting._core.MPLFramePlotMethods
Jose Rivera-Rubio
@jmrr
:+1:
Pav A
@rs2
image.png
@TomAugspurger looks good? :smile:
image.png
Here to highlight interactive tooltips:
Pav A
@rs2
python-sprints/pandas#1
Jose Rivera-Rubio
@jmrr
nice one @rs2
Philipp Rudiger
@philippjfr
I started this prototype weeks ago and kept promising to myself I'd clean it up more but since I haven't had much time I thought I'd share it now and start improving it later. Here's my initial progress on writing a HoloViews based plugin which renders with bokeh: https://anaconda.org/philippjfr/pandas_plugin/notebook
Pav A
@rs2
@philippjfr what makes holiviews superior to plain bokeh?
Philipp Rudiger
@philippjfr
I wouldn't frame it in terms of being superior, they have different usecases. HoloViews provides a higher-level API, which is useful in exploratory analysis and makes it easier to generate certain complex charts, which also means it's much easier to write a plugin like this. Personally my recommendation as one of the main developers on HoloViews is that you should use bokeh when you need to do a lot of custom tweaking on a plot but even then you can combine HoloViews and bokeh or generate your plot in HoloViews and then tweak the bokeh model.
Jean-Luc Stevens
@jlstevens
@philippjfr I don't see you using the holoviews operators on those plots...
I assume you can though
you can combine holoviews visualizations easily with + and *
it would be good if you could update the notebook with some examples of that...
Philipp Rudiger
@philippjfr
There is an example of that, but sure I can add more.
Jean-Luc Stevens
@jlstevens
ah, I must have missed it, sorry!
Philipp Rudiger
@philippjfr
Tiny example, and doesn't show off much, so you've got a point.
Pav A
@rs2
@philippjfr One of the biggest benefits of bokeh is the ability to have custom tooltips. If we have HoverTools added to your notebook that would be awesome.
Philipp Rudiger
@philippjfr
Sure, should be one line of code. The main thing I'm wondering is whether to expose options like that as part of the API, initially I just supported some of the matplotlib options but of course that doesn't expose some of the interactive features that bokeh can add.
epifanio
@epifanio
Hi guys,..I am struggling with a 'selection' widget, to update a bokehplot.
the code should take a pandas dataframe and plot the data column which get selected in a selector widget
I can plot the data if the datframe has a single column, but I am failing in trying to build a CustomJS handler to update the plot
epifanio
@epifanio
I tried to reduce my attempt into this notebook: https://gist.github.com/epifanio/dd8091715620bd414dbb06168dfd1083
I fail in getting the data updated
epifanio
@epifanio
all the SO and tutorial seems to use older version of bokeh
epifanio
@epifanio
ifound my problem is a lack of undrstending of both js and the columndatasource model
epifanio
@epifanio
crossposting from pydata channel .. some of you are may be able to help with this https://stackoverflow.com/questions/61792141/select-and-update-pandas-dataframe-columns-in-bokeh-plot
I tried to work on my toy example, this is what I got :(
I am having troubles in coding in JS, I build a toy example which access the index of a ColumnDataSource but I can't figure out how to update the x values of my data
ikturchaninov
@ikturchaninov
Hello, I am having an issue with how my bokeh plot is initially rendered on the server. I have an interactive plot with a select and slider widget. When I first open the page on the server, everything is squished into the top left corner of the page. When I click on it or make a selection , the plot renders fine and everything works. I am trying to understand why the initial view is messed up