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.
Related
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.
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.
I am currently working on a 3D simulation data. I have a 3D surface, for simplicity, lets say, I have a hemispherical surface. So naturally, I have all the (x,y,z) coordinates that make up the surface. Now I also have a fourth array having the values of some variable (say Pressure for example) at all the (x,y,z) locations that make up the hemispherical surface. My aim is to plot the hemispherical surface and the surface should be coloured according to the fourth array (i.e according to the value of Pressure at that surface).
I have tried pyplot.scatter function from matplotlib, where i use pyplot.scatter(x,y,z, c= Pressure_array) but it leaves me with an artefact like the one shown below (image shows a zoomed in portion of the entire plot)
Notice the fringe like circular pattern. This arises because a Cartesian grid is sampled by a spherical surface and the same is plotted by the scatter points. This pattern remains even upon interpolation of the color values
I am looking for an alternative to the scatter plot method where the surface will be smoother and the circular fringes will be absent. I am aware that matplotlib has surface plots, but i am unable to use it because there, the 'z' coordinate sets both, the height of the plot in 3D and essentially the Color of the surface as well.
Any alternative to scatter plot or surface plot, or a way to get the same domne with the surface plot function in matplotlib will be much appreciated.
I am plotting a distribution of variables that are outputs from two different versions of a program. They look very similar (this is great because they should!) and I am showing their ratio in the same figure but on a different axis. My goal is to show the ratio as a scatter plot but with a horizontal line at y=1.0 to show 100% agreement. The issue I am having is even if I plot the line first and then the scatter, my scatter points still show underneath the line plot. (Please see the image linked below.) You can see the scatter in black underneath the line plot in red, even though I call the plot function first. Any recommendations? Thank you!
Distribution of two variables with ratio plot underneath
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!