I saw a blog post somewhere with plots like these which seem quite popular in the R ecosystem. I've encountered something similar with the package nxviz. How can this kind of graph be replicated in Python's plotly and matplotlib? I'm interested in a somewhat general solution as I've seen lots of things being put inside the grid's boxes. (Note I do know about subplots and scatter matrices by I can't find an option to have lines, nor do I know how to fill the resulting boxes with color-coded circles, text etc, only plots).
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.
We are using Jupyter Notebooks and would like to make our graphical data analysis more interactive: we would like to select an area
in a plot and be able to easly access/ extract the data. We saw that you can do such things with e.g. bokeh. However, we are searching for something "simpler", just a few python code lines any scripting beginners can grasp easily.
We feel that others probably solved this issue many times and we just don't know the right buzz words for searching.
Can you help us searching?
Again, marking and data extracting is the main goal. Additional stretch goals would be:
If you mark some data in one plot, they should also marked in all other plots.
We could use seaborn for plotting.
Thank you in advance and best regards.
I want to use python to plot a diagram like the one in the image below. The purpose of it is to summarize the results of different models using multiple metrics to evaluate.
Is there a way to easily do it in Python, if not can someone refer me to the name of the diagram or a framework I can do it?
Thanks,
What you are trying to draw is called a radar chart.
matplotlib allows the drawing of such a chart.
The matplotlib example above is quite verbose and there may be other, simpler solutions out there. But hopefully, knowing the name of the type of chart will help you in your search. Best of luck!
I have a large data set of tuples containing (time of event, latitude, longitude) that I need to visualize. I was hoping to generate a 'movie'-like xy-plot, but was wondering if anyone has a better idea or if there is an easy way to do this in Python?
Thanks in advance for the help,
--Leo
get matplotlib
The easiest option is matplotlib. Two particular solutions that might work for you are:
1) You can generate a series of plots, each a snapshot at a given time. These can either be displayed as a dynamic plot in matplotlib, where the axes stay the same and the data moves around; or you can save the series of plots to separate files and later combine them to make a movie (using a separate application). There a number of examples in the official examples for doing these things.
2) A simple scatter plot, where the colors of the circles changes with time might work well for your data. This is super easy. See this, for example, which produces this figure
alt text http://matplotlib.sourceforge.net/plot_directive/mpl_examples/pylab_examples/ellipse_collection.hires.png
I'd try rpy. All the power of R, from within python.
http://rpy.sourceforge.net/
rpy is awesome.
Check out the CRAN library for animations,
http://cran.r-project.org/web/packages/animation/index.html
Of course, you have to learn a bit about R to do this, but if you're planning to do this kind of thing routinely in future it will be well worth your while to learn.
If you are interested in scientific plotting using Python then have a look at Mlab: http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/mlab.html
It allows you to plot 2d / 3d and animate your data and the quality of the charts is really high.
Enthought's Chaco is designed for interactive/updating plots. the api and such takes a little while to get use to, but once you're there it's a fantastic framework to work with.
I have had reasonable success with Python applications generating SVG with animation features embedded, but this was with a smaller set of elements than what you probably have. For example, if your data is about a seismic event, show a circle that shows up when the event happened and grows in size matching the magnitude of the event. A moving indicator over a timeline is really simple to add.
Kaleidoscope (Opera, others maybe, Safari not) shows lots of pieces moving around and I found inspirational. Lots of other good SVG tutorial content on the site too.
You might want to look at PyQwt. It's a plotting library which works with Qt/PyQt.
Several of the PyQwt examples (in the qt4examples directory) show how to create "moving" / dynamically changing plots -- look at CPUplot.py, MapDemo.py, DataDemo.py.