How to draw floating pie charts on an existing plot with matplotlib - python

I would like to plot multiple pie charts over an existing plot using absolute coordinates.
I went through the add_axes method and also the AxesGrid toolikt but couldn't find a solution.
To be more specific, I want to draw pie charts over a geographical map using the basemap module.

This tutorial explains how to use matplotlib Basemap for drawing pie charts on a map. It is fairly simple and gives code examples.

Related

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

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.

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!

How to draw this kind of 3D axes with Plotly in Python?

Plotly is an excellent data visualization solution. But I don't like the default style of 3D axes. I want to know, how to draw this kind of 3D axes with Plotly in Python?

Python package for plotting in Arctic Stereographic CRS

I am plotting the drift track of multiple buoys in the arctic. I need a map in the polar stereographic projection and then to plot many latitude/longitude pairs from a dataframe on the the map. What packages work with this. I thought that Folium looked really nice, but I don't think that it can do different projections. There is also basemap, cartopy...
Any thoughts?
Cartopy supports a north polar stereographic projection and can be used with matplotlib to create a map and plot datapoints. The Cartopy documentation includes examples of how to plot points on a map projection.
GeoViews supports NorthPolarStereo projection. GeoViews using a Bokeh extension support map interactivity like panning and zoom similar to Folium.

How to use BaseMap with chaco plots

I had developed scatter and lasso selection plots with Chaco. Now, I need to embed a BaseMap [with few markers on a map] onto the plot area side by side.
I created a BaseMap and tried to add to the traits_view; but it is failing with errors.
Please give me some pointers to achieve the same.
Chaco and matplotlib are completely different tools. Basemap has been built on top of matplotlib so it is not possible to add a Basemap map on a Chaco plot.
I'm afraid I couldn't find any mapping layer to go with Chaco. Is there a reason you cannot use matplotlib for you plot?

Categories