This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Data Visualization with ggplot2</title> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="chrome=1"> | |
<meta name="generator" content="pandoc" /> | |
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 1.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"URUT","R101","R102","R105","R107","R108","R401","R403","R404","R405","R406A","R406B","R407","R408","R409","R410","R411","R412","R413","R504","R505","R506","R507","R508","R509","R510","R511A","R511B","R511C","R512","R513","R514","R515","R603","R604","R605","R606","R607","R608","R609","R610","R611","R612","R613","R614","R615","R616","R617","R618","R619","R620","R703","R704","R705","R706","R707","R708","R709A","R709B","R709C","R709D","R709E","R709F","R709G","R709H","R710","R711A","R711B","R711C","R711D","R711E","R711F","R711G","R711X","R803","R804A","R804B","R804C","R804D","R804E","R804F","R804G","R805","R806","R807","R808","R809","R810","R901","R902","R903A","R903B","R904A","R904B","R905","R906","R907A","R907B","R907C","R907D","R907E","R907F","R907G","R907H","R907I","R907J","R907K","R907L","R907M","R908","R909","R910","R911","R912","R913","R914","R915","R916","R917","R918","R919","R920","R921A","R921B","R921BI","R921BII","R922A","R922B","R922C","R922D","R922E","R922F","R922G","R922H","R922I","R922J","R1001A"," |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# modified from https://matplotlib.org/api/backend_bases_api.html#matplotlib.backend_bases.PickEvent | |
%matplotlib notebook | |
plt.figure() | |
plt.gca().plot(np.random.rand(100), 'o', picker=5) # 5 points tolerance | |
plt.show() | |
txt=None | |
def on_pick(event): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: https://matplotlib.org/examples/event_handling/data_browser.html | |
import numpy as np | |
class PointBrowser(object): | |
""" | |
Click on a point to select and highlight it -- the data that | |
generated the point will be shown in the lower axes. Use the 'n' | |
and 'p' keys to browse through the next and previous points |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# taken from: https://stackoverflow.com/questions/5600370/python-matplotlib-add-and-remove-text-to-figure-using-button-events#answer-5600964 | |
txt = None | |
def onclick(event): | |
global txt # why global txt? because there's a variable assignment | |
txt = plt.text(event.xdata, event.ydata, 'TESTTEST', fontsize=8) | |
fig.canvas.draw() | |
def offclick(event): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def f(): | |
global s | |
print(s) | |
s = "Mukhlisina" | |
print(s) | |
s = "Erika Siregar" | |
f() | |
print(s) # s here is the global s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# since there is a variable assignment inside function f, | |
# f will only care about the local variable 's' | |
# and will not think about the global variable 's' | |
def f(): | |
print(s) | |
s = "Mukhlisina" | |
print(s) | |
s = "Erika Siregar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This function has a global variable | |
# and local variable with the same name 's' | |
# there's a variable assignment inside the function f | |
# thus, it only recognizes the local variable | |
# which is: s = "Mukhlisina" | |
def f(): | |
s = "Mukhlisina" | |
print(s) | |
NewerOlder