What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-06 15:17:01
matplotlib legend out of plot
import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 20, 1000) y1 = np.sin(x) y2 = np.cos(x) plt.plot(x, y1, "-b", label="sine") plt.plot(x, y2, "-r", label="cosine") plt.legend(loc="upper le... Add solution -
Python 2021-09-06 03:39:01
python tkinter plot points
from tkinter import * from tkinter.ttk import * import matplotlib matplotlib.use("TkAgg") from matplotlib.figure import Figure from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg root = Tk() figure = Figure(figsize=(5, 4), dpi=10... Add solution -
Other 2021-09-05 10:54:02
how to read jason file in jupyter notebook
import numpy as np import pandas as pd import seaborn as sns import matplotlib as plt import json %matplotlib inline with open("pud.json") as datafile: data = json.load(datafile) dataframe = pd.DataFrame(data) Add solution -
Python 2021-09-05 07:54:02
position of legend matplotlib
import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 20, 1000) y1 = np.sin(x) y2 = np.cos(x) plt.plot(x, y1, "-b", label="sine") plt.plot(x, y2, "-r", label="cosine") plt.legend(loc="upper le... Add solution -
Python 2021-09-04 16:06:01
make pandas dataframe from elasticsearch
from datetime import datetime from elasticsearch import Elasticsearch from pandas import DataFrame, Series import pandas as pd import matplotlib.pyplot as plt es = Elasticsearch(host="192.168.121.252") res = es.search(index="_all", doc... Add solution -
Other 2021-09-03 20:31:01
change xlabel rotate in seaborn
# Basic syntax: plt.set_xticklabels(plt.get_xticklabels(), rotation=45, horizontalalignment='right') # Example usage: import pandas as pd import seaborn as sns import matplotlib.pyplot as plt # Import data data = pd.read_csv("https://raw.githubuser... Add solution -
Python 2021-09-03 13:30:01
python roll dice 100 times graph results
import numpy as np import random import matplotlib.pyplot as plt def die_roll(rollnum, maxdots=6, ausgabe=""): all_rolls = np.random.randint(1, maxdots+1, size=rollnum) if "T" in ausgabe.upper(): i = 1 ... Add solution -
Python 2021-09-03 08:22:02
how to use visualize_runtimes
import threading import multiprocessing import math import numpy as np import time import matplotlib.pyplot as plt import glob from PIL import Image import random from random import sample import string from concurrent.futures import ThreadPoolExecutor ... Add solution