1

I've written a sample program for using maplotlib and seaborn:

import matplotlib as plt
import numpy as np
import random
import seaborn as sns
rolls = [random.randrange(1, 7) for i in range(600)]
values, frequencies = np.unique(rolls, return_counts=True)
title = f'Rolling a Six-Sided Die {len(rolls):,} Times'
sns.set_style('whitegrid')
axes = sns.barplot(x=values, y=frequencies, palette='bright')

Everything is calculated correctly (I've omitted print's for brevity), but nothing shows up.

I've tried either under command line, and with vscode.

I'm running windows 7, python 3.7.7 and conda 4.8.3

What am I missing?

Thanks

1
  • 1
    Try including plt.show() at the end of your code Commented Apr 13, 2020 at 14:49

1 Answer 1

1

you need to print the graph, you need next lines of code

soportes[:].plot.bar(x='row', y='column')

#soportes[row_init: row_finish].plot.bar(x='variable', y='variable')

plt.ylabel('Soporte') #name axis y

plt.xlabel('Producto') #name axis x

plt.title('Soporte por producto Prior') #name windows

plt.savefig('Graph/Prior_Barra.png', bbox_inches="tight") #save graph

plt.show() # to show graph

delete line axes = sns.barplot(x=values, y=frequencies, palette='bright')

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.