Skip to content
Advertisement

Tag: matplotlib

Animating two circles Python

I have a text file, with the coordinates of two circles on it. I want to produce a live animation of both particles. For some reason the following code crashes The text file that the data is taken from has the columns of X1, Y1, X2 and Y2 where X1 represents the x coordinate of the 1st particle etc. If

How to make sns.jointplot histogram into a smooth kde?

I’m plotting some data using sns.jointplot and I want the data inside the scatterplot to remain as points and the histograms on the side to be kde plots instead. I’ve tried using the kind=’kde’ argument, but this changes the data inside to not look like points in a scatterplot anymore. I’ve searched around for a bit and can’t find how.

Returning plt.show() on HTML with Python Flask

I’m using Python Flask to take input from a simple html file. The HTML asks the user to input a state and when they do that I would like for the output to be a plot. I have the following code that’s creating the Python Flask but when a user inputs a state, the plot outputs in my Jupyter Notebook

How to make just one marker as hollow in matplotlib plot?

I have the following code: I tried the above and got the following error- How do I resolve this ? or is there an alternative solution to the problem ( rather than splitting into multiple figures)? Answer If you read the documentation associated to plt.plot, if you will see that the only properties affecting markers are: By looking at them,

Images constructed from dataset rotated

I am not very experienced with python plotting. I want to work with YaleB_32x32 dataset (https://github.com/flatironinstitute/online_psp/blob/master/datasets/YaleB_32x32.mat). This is my code : This is the output. As you can see that images are rotated. Could someone please help me with where am I going wrong? Answer You can use rot90 to rotate faces with numpy lib. Use axes=(1, 0) to rotate

Superscripting a string in python

Hello I am trying to superscript a string for a plot. And the result i get is: The “-0,2*x” should be superscripted. What am I doing wrong? Thank you! Answer It IS making the – a superscript. To get the whole expression in there, you need to enclose the whole expression in curly braces. Since you have this in an

Advertisement