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 -
Python 2021-09-01 06:11:02
matplotlib line plot
from matplotlib import pyplot as plt # Median Developer Salaries by Age dev_x = [25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35] dev_y = [38496, 42000, 46752, 49320, 53200, 56000, 62316, 64928, 67317, 68748, 73752] plt.plot(dev_x, dev_y) plt.xlabe... Add solution -
Python 2021-08-31 15:09:01
change ticks font size matplotlib python
from matplotlib import pyplot as plt from datetime import datetime, timedelta xvalues = range(10) yvalues = xvalues fig,ax = plt.subplots() plt.plot(xvalues, yvalues) plt.xticks(fontsize=16) # sets font size of xticks to 16 (respective of yticks) plt.... Add solution