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-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 -
Go 2021-08-30 19:28:01
matplotlib logo image on a plot
import matplotlib.image as image import matplotlib.pyplot as plt im = image.imread('debian-swirl.png') fig, ax = plt.subplots() ax.imshow(im, aspect='auto', extent=(0.4, 0.6, .5, .7), zorder=-1) ax.yaxis.tick_left() ax.tick_params(axis='y', colors='black... Add solution