A 2D bar chart in a 3D chart using Plotly - python

I am trying to plot 2D bars in a Plotly 3D figure. I understand that Plotly's 3D figures do not yet support bar charts out of the box, but I have come across some examples from other people on the Plotly forums which have shown how this might be achieved.
Please see the post Adding a shape to a 3D plot. This is close to what I am trying to achieve, but I am not trying to plot a histogram.
It appears plotting traces as a mesh3d, adding in the missing points and triangulating is the way to go for Plotly's 3D chart, according to other examples I have seen. Below is an example of what I am looking for that I created using Matplotlib.
As you can see, x axis is the date, y axis is the trace name and z axis is the value. I would like to see if I can achieve something similar using Plotly's 3D charts, which are so much better of course because of the client side interactivity.
Is there a working example for what I'm trying to achieve? I am simply looking to plot simple (date, value) per trace as 2D bars in the 3D figure.

There isn't any current way to have a bar chart in 3D with Plotly (at least that I am aware of).
Documentation: Plotly Python Open Source Graphing Library 3D Charts
As shown in the documentation, there aren’t any options for a bar chart. There are, however, alternatives like a bubble chart.

Related

Manually specify shape of plotly violin or similar trace when using categorical axes

I am aiming to combine two types of charts - a horizontal bar chart using a categorical axis and some form of line, scatter, violin, or similar chart that displays a trace paired with each category on the same axes but "dithers" up and down around some bounds.
Below is sort of what I'm trying to create. However, the shape of the violin chart is generated automatically behind the scenes from scattered points. In my use case, I already have what the distributions are and I'm trying to plot them over top of related data.
I can't find a utility in Plotly that allows me to specify a categorical axis, but then offset points, lines, etc from that category-derived position on the axis.

Plotly scatter matrix with color showing density

Is it possible to do a scatter matrix plot with Plotly in which the color shows the density like this (not Plotly)?
I would like to have the functionality of the px.scatter_matrix function, i.e. that the axes are shared, and also a similar interface if possible. I cannot find such thing.
If it is not a scatter plot with individual points but a collection of 2D histograms that would also work.

How to add box plots on top of scatter plot

I want to plot boxplots on top of the scattered points like this.
I know I have to bin the data into intervals first but I couldn't find the function that does all of this. Sample x and y data are saved here as .npy.
I would look into using matplotlib. Boxes can be drawn as such:
https://matplotlib.org/gallery/pyplots/boxplot_demo_pyplot.html?highlight=boxplot
and scatter plots can also be drawn as such: https://matplotlib.org/gallery/lines_bars_and_markers/scatter_demo2.html?highlight=scatter
There is a search functionality on their site, along with plenty of documentation on how to utilize their library.
As for your specific question, you can specify zorder when drawing many of the things in matplotlib, and you could use that to define your boxplots to be on top. I believe if no zorder is defined that it draws items in the order they are encountered in your program (so you could draw scatter plots and then box plots and they should appear correctly as in your diagram above!

Two violin plots (horizontal and vertical) intersecting at a point

I am unsure whether this functionality is possible through Plotly or if it is achievable with other plotting packages so I am open to different solutions.
I am trying to plot two violin plots in a single figure where one violin is oriented horizontally while the other is vertical. I would like to specify the point at which they intersect (i.e the primary axis of each). Ideally each would be transparent and interactive.
Somewhat poor illustration of what I need
Thank you for any proposed solutions!
There are multiple Python libraries doing Violin Plots. Plotly is among them, check its manual.
Besides, Seaborn is really good at this:
It is a Python visualization library based on Matplotlib. The code snipped for the above example can be found in Seaborn's gallery.

How to return a histogram and a scatterplot using matplot lib?

I need to return both a histogram and a scatterplot in one function using matplotlib, but when I try to create the histogram after creating the scatterplot, it appears that the scatterplot gets overridden. Just wondering if anyone has any advice on this issue? Is there a way to return two plots at once if they share an x-axis?
For instance, there is paragraph included in this link http://matplotlib.org/users/pyplot_tutorial.html about how to have 2 subplots. But I'm not sure how to do that with plt.hist() and plt.plot().
Since the histogram fills the bars it is probably better to do it first then the scatter plot.

Categories