Plotting multiple different plots in one figure using Seaborn

One possibility would be to NOT use lmplot(), but directly use regplot() instead. regplot() plots on the axes you pass as an argument with ax=. You lose the ability to automatically split your dataset according to a certain variable, but if you know beforehand the plots you want to generate, it shouldn’t be a problem. Something like this:

matplotlib error – no module named tkinter

For Linux Debian based distros: RPM based distros: For windows: For Windows, I think the problem is you didn’t install complete Python package. Since Tkinter should be shipped with Python out of box. See: http://www.tkdocs.com/tutorial/install.html . Good python distributions for Windows can be found by the companies Anaconda or ActiveState. Test the python module p.s. I suggest … Read more

Changing the “tick frequency” on x or y axis in matplotlib?

You could explicitly set where you want to tick marks with plt.xticks: For example, (np.arange was used rather than Python’s range function just in case min(x) and max(x) are floats instead of ints.) The plt.plot (or ax.plot) function will automatically set default x and y limits. If you wish to keep those limits, and just change the stepsize of the tick marks, then you could use ax.get_xlim() to discover what limits Matplotlib … Read more

A tool to convert MATLAB code to Python

There are several tools for converting Matlab to Python code. The only one that’s seen recent activity (last commit from June 2018) is Small Matlab to Python compiler (also developed here: SMOP@chiselapp). Other options include: LiberMate: translate from Matlab to Python and SciPy (Requires Python 2, last update 4 years ago). OMPC: Matlab to Python (a bit outdated). Mat2py: Matlab … Read more

pyplot scatter plot marker size

This can be a somewhat confusing way of defining the size but you are basically specifying the area of the marker. This means, to double the width (or height) of the marker you need to increase s by a factor of 4. [because A = WH => (2W)(2H)=4A] There is a reason, however, that the size of markers is … Read more

Add Legend to Seaborn point plot

I would suggest not to use seaborn pointplot for plotting. This makes things unnecessarily complicated.Instead use matplotlib plot_date. This allows to set labels to the plots and have them automatically put into a legend with ax.legend(). In case one is still interested in obtaining the legend for pointplots, here a way to go: