Category : matplotlib

I have created a figure using matplotlib and saved it using savefig function. following is the code i used, import matplotlib.pyplot as plt x = [0, 2, 4, 6] y = [1, 3, 4, 8] plt.plot(x,y) plt.xticks([]), plt.yticks([]) plt.box(False) plt.savefig(‘plot.png’) plt.show() When i run the following code in google colabs it generates an image with ..

Read more

I’m trying to set a seaborn palette in a Python script in Spyder using this: import seaborn as sns sns.set_palette("Reds") It doesn’t really matter what palette I pass as an argument, I always get the error below: Traceback (most recent call last): File "<ipython-input-20-efc46ee41836>", line 1, in <module> sns.set_palette("Reds") File "c:userslucas-magalhaesanaconda3libsite-packagesseabornrcmod.py", line 550, in set_palette ..

Read more

I have sorted the sectors based on the price earning ratio. Now, I need to make a pie chart of Sectors sorted by top 20 price earnings ratio. Example- IT(6/20)-30% data.head() pe = data.sort_values(by=’Price/Earnings’, ascending=False) pedf = pd.DataFrame(pe) pedf20 = pedf.head(20) plt.figure(figsize=(10, 6)) plt.title("Sectors with highest pe ratio") Source: Python..

Read more

I would like to draw 3D geometry drawings of this type: https://en.wikipedia.org/wiki/Spherical_coordinate_system#/media/File:Spherical_coordinate_system.svg But I want to be able to 3D rotate/pan/zoom like you normally can with matplotlib, and I want the result to be with this flat aspect, like paper illustrations. Rotation and panning would help me study a problem from multiple view angles and ..

Read more