-
Notifications
You must be signed in to change notification settings - Fork 598
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
Minor fixes and Comments #25
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# import required libraries | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
|
||
|
@@ -11,4 +12,5 @@ | |
ax.plot(x, y, color='black') | ||
ax.set(xticks=[], yticks=[], title=name) | ||
|
||
#printing plot in IDE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This neither prints, nor uses an IDE, so I don't know what this comment means. |
||
plt.show() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
#import required libraries | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
np.random.seed(1) | ||
np.random.seed(1) # generates exact same random values as they are here inside .seed(value) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since I suppose the comment is mainly useful for absolute beginners, and this carries a bit of ambiguity (
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest using what we use in Matplotlib examples: # Fixing random state for reproducibility
np.random.seed(19680801) |
||
|
||
# Generate data... | ||
# Generate Random data... | ||
y_raw = np.random.randn(1000).cumsum() + 15 | ||
x_raw = np.linspace(0, 24, y_raw.size) | ||
|
||
|
@@ -23,8 +24,10 @@ | |
|
||
# Now you're on your own! | ||
|
||
#making sublots | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment does not really add anything. |
||
fig, ax = plt.subplots() | ||
|
||
#Styling the Plot a little ... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't just style; it does the actual plotting too. So this comment needs to be expanded a bit more. |
||
ax.plot(x_raw, y_raw, color=linecolor) | ||
ax.bar(x_pos, y_avg, width=bar_width, color=barcolor, yerr=y_err, | ||
ecolor='gray', edgecolor='gray') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a particular reason for putting this paragraph in code?