-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting no output in Python #57
Comments
|
Thanks for the quick response! When I do that the output line disappears, but nothing opens still. Could it be something with my settings? |
Ok yes it is probably something to do with how you installed matplotlib. Within that realm, there are a couple of things that could be happening. Let's try looking at the backend configuration of your matplotlib first. (1) Open your terminal and enter in the following command to get the file and path and name of your matplotlib setup/config file:
(2) Copy the file path and name that comes up and open that file either in a text editor or vim (whichever you'd feel comfortable with)
(3) You need to find where your backend is specified. If your file is the same as the one I have on my machine (which theoretically it is), there should be a comment (4) Once you've saved the file you should be able to run your program and see your plots. Let me know if this doesn't work for you- as I said there are a few different things that could be happening here. Also feel free to come to office hours if you're (rightly) confused about this stuff. |
Thanks for this detailed step by step. When I enter the first line in the terminal, nothing happens. I might not be able to make it to office hours to figure this out (sorry I didn't realize this yesterday during lab!) |
Oh yes of course- sorry I forgot to explicitly specify that before you do any of this you have to enter into a python environment in your terminal with the command |
Thanks - so I went through and checked, and the backend is set to macosx already. |
Hmm cool. Could you try saving the figure instead of showing it?
Does this command save the figure for you? |
Hello,
I ran the first two chunks of code to input the data for assignment 2 and to get the histogram. When I try to do the next part, it says Out3: <matplotlib.legend.Legend at 0x1a12cfaef0>
This is my code:
def truncnorm_pdf(xvals, mu, sigma, cutoff):
if cutoff == 'None':
prob_notcut = 1.0 - sts.norm.cdf(0, loc=mu, scale=sigma)
else:
prob_notcut = (sts.norm.cdf(cutoff, loc=mu, scale=sigma) -
sts.norm.cdf(0, loc=mu, scale=sigma))
mu_1 = 11$\mu$ =11,$\sigma$=0.5')
sig_1 = 0.5
plt.plot(incomes, truncnorm_pdf(incomes, mu_1, sig_1, 15000),
linewidth=2, color='r', label='1:
plt.legend(loc='upper left')
Thanks!
The text was updated successfully, but these errors were encountered: