'circos' style plots with matplotlib? [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Does anybody know if there's a way to make circos-style plots with matplotlib python package, or any other python library? They don't have to be as nice looking as the example.

As far as I know, there is no direct functionality for this. If I were to create this functionality, I would use polar plots as the starting point, then I would create a transformation to convert data positions along the circular axis to polar coordinates.

Yann's idea is great.And more, circos is developed by Perl with GD and other modules, and then output SVG (or png). Python can also do this if you want to create new wheel :)
As I know if you wanna circos style images (circular style) by matplotlib, you'd better write raw python code directly :
learn basic SVG grammar
use python to generate the basic layout
design your image elements
computing and transforming your data coordinates; you'd better think it in polar coordinates (I did the same things but without open source.)
output your elements.
If you like, join circos's google group to discuss: http://groups.google.com/group/circos-data-visualization

It seems that Biopython's module GenomeDiagram has similar functionality, although it is designed for plotting genomic data, but not any data, as in circos, and the output won't be that nice.

Related

Why we use plt in general not the name of the object? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
When we plot in python we generally use plt.~ not the specific name of the object, why?
and What if I want to plot a separate graph in one code?
This is maybe not really a question of programming, but one about culture.
The pyplot API is modelled after the plotting functions in MATLAB, and therefore, it has a lot of imperative style as heritage.
However, that API is a bit clumsy at times, as you suggest. It is recommended to instead use the object oriented API: Read more in the official docs: https://matplotlib.org/api/index.html?highlight=pylab
PS.
One can also take note that there is a deprecated API called pylab as well, which is even more similar to the MATLAB environment. You can find examples of it when looking at really old tutorials on numpy and matplotlib, but it is generally phased out.... It is further described in the above linked documentation.

What is an efficient way of rendering a 3 dimensional Conway's Game of Life in Python? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm curious what a 3D implementation of conway's game of life would look like and thought it would make a fun side project. I'm trying to decide how to render the live/dead cells in 3D.
I'd like all the visuals to occur within an n * n * n cube, like a rubik's cube where all internal cells are also used. The only functionality I really need is the ability to change the colors of the "cells" after a certain time interval. Is there a framework or library that I could use to make the creation of the cube?
I created an implementation with Matplotlib using the "voxels" function but after about 150 boxes it gets too slow to even rotate, and seeing as it is going to be changing every hundredth of a second I dont anticipate mpl could handle it without some optimization that I'm as of yet unaware of. I've been trying to find more information about Python volume rendering techniques for this specific problem but i cant find the term for a "cube made out of cubes" so it has been difficult.
Thanks for any help.
The update rule for the game of life (in any dimension) is based on the value of the convolution of the board with a "counting" mask. (all ones in a little 3x3 (or 3x3x3 in your case) region. So, I would suggest using something like tensorflow (probably pytorch works fine too) and using tf.nn.conv3d to do that step fast. You probably need the GPU anyway to be able to rotate the thing quickly.

How to make seaborn and bokeh plot publication level? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
How would I make seaborn and bokeh plots to look professionally for a scientific paper:
Can someone advise on some common practices when creating publication level figures in python?
As #brentertainer pointed out in his comment, seaborn is a effectively a wrapper around matplotlib and with matplotlib you can do virtually anything. Here is a nice library, which can guide you and provide some overview on what is possible. One of the most important things to be comfortable with is the axes object, which you can modify to your specific use case (see example below). From seaborn there should be a way to access the axes object (and other matplotlib structures) to modify it to your delight.
I do almost all my publication figures with matplotlib, with some minor modifications, informed by the style rules of Edward Tufte. I use the following function, that I compiled/ aggregated from several stack overflow questions and tutorials. (I will do some research so give sources for this on monday). The function (in my case used for bar charts) takes an axes object and modifies it to remove some unneeded lines etc.
def tuftefy(ax):
"""Remove spines and tick position markers to reduce ink."""
#
ax.spines["top"].set_visible(False)
ax.spines["right"].set_visible(False)
ax.spines["left"].set_visible(False)
ax.spines["bottom"].set_visible(True)
ax.spines["bottom"].set_color('grey')
ax.grid(color="w", alpha=0.5)
ax.get_yaxis().grid(True)
ax.get_xaxis().grid(False)
However, this is a rough example of what you can do. Your main focus should be: What do I want to communicate with my figure. Pick a figure type that serves this purpose best (for example via the matplotlib example library and/ or your domain knowledge) and apply a style that supports it.
I would use matplotlib. A non-python package that many physics journals like is gnuplot. I would review the submission procedure for the journals you are aiming for also :)

Analytics using PYTHON [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I would like to Learn About DATA Analytics.
Where to start it?
Where I can find the concepts about analytics?
What are all the Frameworks in PYTHON used for analytics?
Which could be good for my career(PYTHON or R)
There are vast choices for data analysis in Python. There are many frameworks which ensure that you do not have to reinvent the wheel.
Some of the major of them are:
1) NumPy: It is a Python library providing easy access to arrays, matrix operations and linear algebra.(You may also consider SciPy)
2) Pandas: It is a library which provides you 2D datasets or dataframes to store data. They are handy at times.
3) Matplotlib: It is a great library for making and plotting 2D graphs. It has the ability to make graphs and histograms with just a few lines of code.
Where to start it? Where i can find the concepts about analytic?
Data analytic/analysis is a huge concepts, but a good way to start is find a problem (data to analyse) and solve it. My suggestion is to buy a book. For example if you like to use python i suggested: "Python for Data Analysis".
What are all the Frameworks in PYTHON used for analytics?
As suggested in the other answer Numpy, Pandas and Matplotlib. Furthermore, Scipy more useful for Statistical problem. Another framework really interesting is scikit-learn http://scikit-learn.org/stable/.
Ps: a good framework that include all the former package is called Anaconda

Loading a geographical map in Python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to write a program that gets the geographical coordinates of a point, and then displays a map of some area around this point (for example a square that its center is the point and its side is R km) and saves it as an image file. Preferably, the map would also include streets names etc. What is the simplest, most straightforward way to do it? what package should I use?
Thank you.
I would personally look for a web service instead of a Python package for this kind of complex tasks involving massive databases (read: MAPS).
Have a look at OpenStreetMap or Google Maps APIs.
If you just have the coordinates you could use something like matplotlib basemap:
http://matplotlib.org/basemap/users/examples.html

Categories

Resources