Plot errorbar using panel and hvplot - python

I have a dataframe with some values y and their uncertainties, from df I generate an interactive dataframe idf = df.interactive(), apply some widgets from panel (pn.widgets.RadioButtonGroup) and then I plot everything via a pipeline pipeline= (idf.groupby([some stuff])['y'].mean().
Afterwards I generate a plot using pipeline.hvplot which I can later incorporate in a panel template.
My question is: how can I add to the hvplot the errobars?
Thanks a lot!

Related

Stacked bar chart in matplotlib without hardcoding the fields

I am trying to create a simple stacked bar chart using this data using ONLY matplotlib, pandas and numpy:
x-axis: Month
Labels: activity type
Height: distance
The examples I see, loop over the x-axis, but labels are always hard coded.
Can we loop over everything? In other words, can I create a chart without modifying this table:
No group by or pivot, just use the table as is and get the chart using matplotlib, pandas and numpy only (learning those at the moment)

Context menu to select data source in matplotlib subplots (Jupyter)

I'm trying to build a dynamically customizable plot in jupyter with matplotlib. I already have sliders where I can select how many subplots shall be shown (x*y). But now I want to fill these subplots with data. I have a fix set of data series, and would like to have a context menu when I do a right click on the subplot where I could select the data series that shall be displayed. But I can't find any solution how to pop up a windows on a subplot and return the selected series. Do you have any idea/example for me how to solve this?
Thanks and best regards!

Plotting a boxplot using Pandas

I'm trying to plot a box plot using pandas.
The code for the same using seaborn is as follows:
sns.boxplot(y='Salary', data=eda)
and this is the code I use while using pandas:
boxplot = eda.boxplot(column=['Salary'])
is there any way I could get the same box plot using pandas as I did while using seaborn?
Edit: I need the column 'salary' on the y-axis while using pandas
Thanks!

bokeh timeseries chart axis dateslider

Is it possible to display a datetime axis for a timeseries chart as a dateslider widget in Bokeh? So that the chart history updates with the range selected via the dateslider?
If so, can you please provide an example?
There is an example of the RangeTool in the documentation gallery:
https://docs.bokeh.org/en/latest/docs/gallery/range_tool.html

How do you get the range of the x-axis of a Plotly graph?

I'm trying to retrieve the range of the x-axis when you zoom in a plotly scatter plot, but when I tried to access it using:
figure['layout']['xaxis']['range']
it just returns 'None'.
This is the code that I am using to create the graph:
# self.plot contains the dataframe passed to the function to be plotted
self.plot = df
# Creates the plotly plot figure
self.fig = self.plot.iplot(asFigure=True,kind='scatter', xTitle='Date', yTitle='Temperature')
# Displays the plot
iplot(self.fig, show_link=False)
I'm using cufflinks to create the plot from a pandas DataFrame so I don't explicitly set the layout.xaxis.range to anything. Also I'm using a Jupyter Notebook to display the graph, if that helps at all. So is there any way of getting the range of the x-axis of the current view window of the plot? Thanks in advance!
That does not seem to be possible at the moment using python. There's a post on community.plot.ly that says:
Graph parameters don’t dynamically change with chart actions. However,
as you zoom, the plot does emit data regarding the new x-axis range,
you’re unable to to access this information directly in Python.
Instead you’d have to use javascript:
https://plot.ly/javascript/zoom-events/

Categories