Image background in bar charts using bokeh (python) - python

I have a basic bar chart with the x-axis having categorical values of countries. I want to give each bar, an image background of the country's flag, to make the chart more appealing also to eliminate the x-axis labels. I am currently using bokeh for my charts and I dont think it is possible via this. Any ideas for the same, maybe some other python libraries which might do the trick?
Thanks

Related

Is there a way to draw a radar chart with Altair in python?

I have been using the Altair python API for a Data Visualization project, and everything went smoothly until I wanted to add a radar chart to my app.
I could not find anything on Altair's python API documentation about radar charts, however there seems to be an entry about that in Altair's core documentation but I couldn't access it.
I saw that plotly had that feature but I would really have liked using only one plotting framework...
Is there really no way to make a radar chart with Altair in python ?
This is currently not implemented in VegaLite, you can see the discussion in these two issues and open a new one if you think there is a good case to be made for radar charts:
https://github.com/vega/vega-lite/issues/3805
https://github.com/vega/vega-lite/issues/408
In Altair you might be able to hack something together by layering multiple mark_arc charts with a fillOpacity=0 and a colored stroke (although I don't think this will work since I can't see any way to get right of the lines going towards the middle.

MACD plot in python similar to tradingview figure

Here is an example of MACD plot using python.
https://code.luasoftware.com/tutorials/algo-trading/python-mplfinance-plot-yfinance-candle-chart-moving-average-macd-and-volume/
I'd like the result (including colors and crossover points, etc.) to be the same as that of tradingview.com
https://www.tradingview.com/script/NDH8bJow-MACD-Colors-Signals/
Could anybody show the python so that it is the same as that of tradingview.com?
Could anybody show the python so that it is the same as that of tradingview.com?
I don't think anyone is going to want to write your code for you.
However what I would recommend is that you work through the mplfinance tutorials on Customizing the Appearance of Your Plots and especially teach yourself about mplfinance styles which shows how to modify the overall color scheme of your plot. See also mplfinance style sheets reference.
For example, to achieve a color scheme similar to trading view you could use the "market colors" from style 'yahoo' and the combine that with mplfinance style 'nightclouds'. Something like this:
mc = mpf.make_marketcolors(base_mpf_style='yahoo')
s = mpf.make_mpf_style(base_mpf_style='nightclouds',marketcolors=mc)
Then when you call mpf.plot() specify kwarg style=s
hth

Python plotly: bars hardly visible from background

I am trying to build a default bar chart in plotly using Plotly express (imported as px). However, the default (and manually chosen) colors hardly differ from the background. The legend will show appropriate colors.
edit: The very basic call
px.bar(credit_cards, x='Marital_Status')
will give similar if not less visible results.
An image of the Notebook
is attached.
Thanks in advance!
Edit/kind of solution: using px.histogram instead of px.bar displays bright colors. I would still be interested in what is wrong with bar, though.

Update source data through chart in Python

Is there any way in Python to modify the source data by moving data points in the chart?
This is intended to work in streamlit: I'd like to make it convenient for users to edit multiple parameters of the same kind visually changing the curve which represents series of parameters and their corresponding value. As far as I know, streamlit currently supports Matplotlib, Plotly, Altair, Bokeh, Vega Lite, Deck.GL, dagre-d3 charts, but not sure whether any of those libraries provide this functionality.

Multiple bars of the same data on the same y-axis in Bokeh

I'm using Bokeh's hbar_stack() method in order to make a stacked horizontal bar chart.
In Matthew Rocklin's post here, the very first chart plots how long tasks take on different worker cores. It plots "read-block" and "pandas_read_text."
I was wondering how you could get multiple bars of a phase (ex. "read-block") onto the same y-axis when using hbar_stack(). Any general advice behind how this chart is created would also be helpful.

Categories

Resources