How to make Stand alone 3d interactive scatter plot program in python like plotly in Jupyter? - plot

plotly is really good package for plotting. This package surports interactive 3d plots.
Users can rotate, zoom, and select to show detail informations about the single spot.
But it only work with jupyter.
But I want to make standalone program, a single exe file, to show a plot.
in similar case, I made a program with matplotlib or tkinter.
but, now I need 3d and interactive. and should deploy this 3d plots to my teamates.
How can I make standalone 3d interactive plot by python? never use jupyter.

Related

How can I use Cairo to replace ggplot graphics in PowerBI

I am working on a ggplot graph to be used within PowerBI. I would like to use Cairo to improve the look of the graph. When using the CairoWin() function in RStudio it generates a popout window. The same happens in PowerBI. This is no good for the PowerBI dashboard as I need the Cairo generated graph to remain embedded in the dashboard replacing the current ggplot graph not as a popout.
I have tried the Cairo documentation but, no luck. Is there anyway for Cairo to replace the ggplot generated graph instead of creating a popout window?

Interactive plots of simplicial complexes

I'm attempting to create interactive plots of simplicial complexes Simplicial Complex
using the python library plotly. So far, I've only managed to create interactive plots of the underlying graph(the vertices and the edges). This I learned from this: 3d network interactive graphs However, when the complex has triangles(let's stick to 2-dimensional complexes), I wish to plot those triangles too. I'm not able to find anything regarding this on the internet. Can anyone point me to a source on how to achieve this?

Overlay plot on map background in R

I want to make a windrose plot on a specific location. Windrose can be plot with openair package
library(openair)
windRose(mydata, "ws", "wd")
or with ggplot using this function. What I am looking for, a nice way to overlay this plot on a map. I tried with ggmap (I don't have a google map API key) and leaflet. This example also I tried, the output is below.
Is there a way to overlay ggplot on leaflet map or any other ggmap way to do it nicely.
That is a multi-step process and will take a bit of tweaking to make it work the way you want but it can be done in 3 steps.
Set the background of your chart to transparent
Save a png locally
Use addLogo() from mapview package to post the image to your map and place it
For sure you will need to problem solve some as you implement this process. If you are doing this in Shiny you would want to use directory management to create and destroy the plots as data updates and be sure to make the creation of the graph reactive or observed in some way.
If you are making a nice rMarkdown dashboard, just make sure you keep track of where the png file saves and use the proper addressing.

Is there a way to recover a ggplot2 image from a Plotly image?

I have some code that generates a plotly image in R. Previously I included this plot in a presentation using Rstudio/ioslides. The people I am collaborating with want a version in powerpoint. I am trying to use the ReporterRs package in order to create an re-producible shell powerpoint presentation with all of my plots. However ReporterRs only accepts lattice, ggplot2, and base images. Since there is a way to convert ggplot2 objects to plotly images I was hoping there was a way to go backwards. However I am stuck. I have been unable to "downgrade" my plotly plots to ggplot2. Does anyone know if there is a way to do this?
(I know I can just copy and paste them over but I would like to develop a workflow where I can create easily reproducible and replaceable plots so that I don't have to do very much work if I change the data)

Is there a way to create interactive plots (a la D3) in IPython notebooks?

I found those two answers:
Animated graphs in ipython notebook ,
How to grab matplotlib plot as html in ipython notebook?
But they don't address interactivity. I would like to display a plot with 2-3 curves and let the user hover those curves to receive more details or control the parameters that are used to generate those curves from a combo-box
check the following answer at iPython: Manipulate-like command.
as well as the two following directions:
IPython interact/ive as motivated in IPython - The Attributes ofSoftware and How They Affect Our Work - Brian Granger near 32m:12s; and available at IPython's github
Altair provides a powerful and succinct syntax, based on vega-lite; see the gallery
MPLD3: Bringing Matplotlib to the Browser
I don't believe the standard matplotlib plots are capable of the interactivity you want. Chaco can do interactive graphs, but not in an ipython notebook, AFAICT. Your best bet is probably Bokeh. It outputs to Javascript/HTML, can do interactive graphs, and has an example of using it from ipython.
You may want to check out Plotly. They render interactive D3 plots inside IPython Notebooks (examples here. You can export as static images as well, and zoom, hover, pan, and see text on the hover. Interactivity is one of the pitches they're emphasizing. For more, you can also use IPython widgets inside the Notebook, which gives you more control and options. For example:
Like #AFoglia, I'm going to suggest other libraries that might be what you're looking for: Tangle, Mathematica Notebooks, IPython / Bokeh, RactiveJS, or ReactJS.
Another solution might be the Charts library. It enables you to use the excellent Highcharts javascript library to make beautiful and interactive plots out of the box.
Some features:
Vector plots which you can download in .png, .jpg and .svg formats so you will never run into resolution problems.
Interactive charts (zoom, slide, hover over points, ...)
Usable in an IPython notebook
Explore hundreds of data structures at the same time using the asynchronous plotting capabilities.
Disclaimer: I'm the developer of the library
You can run javascript straight from IPython notebooks (%%html and %%javascript), so it should be possible to run D3 code. Check this video. The exact way in which this would be implemented is not set in stone yet, as this is a feature for IPython 2.0. There are many hacks available as of now, as well as projects that try to port some characteristics of D3 to Python (such as bokeh and python-nvd3).
I have not yet tested any of these. My own bias would be to try the example below first, which is static, but uses D3 directly (so it should theoretically work for interactive plots):
gist
notebook
Other answeres here seem to be outdated. IPython 2.0 has support for interactive widgets. Read the docs including some examples, but note that the nbviewer.ipython.org does not show the interactive widgets. Copy & pasting the examples to try.jupyter.org works.

Resources