What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-16 22:07:02
how to check if y axis is inverted matplotlib
import matplotlib.pyplot as plt # ('gca' stands for get current axes) # To check whether the y axis is inverted: plt.gca().yaxis_inverted() # To check whether the x axis is inverted: plt.gca().xaxis_inverted() """ Both functions return... Add solution -
Python 2021-09-16 15:45:02
mathplolib avec date
import matplotlib.pyplot as plt data = [49, 20, 37, 28, 20] jours = ["14/02/2016", "15/02/2016", "17/02/22016", "28/05/2016", "15/07/2016"] plt.plot(data) #1 seul argument: 'data' plt.x... Add solution -
Python 2021-09-16 15:42:03
gradient ascent algorithm python
import matplotlib.pyplot as mp, numpy as np # Primitive origin = lambda x: 2 * x - x ** 2 x = np.linspace(0, 2, 9999) mp.plot(x, origin(x), c='black') # Visualization # Derivative of the original function derivative = lambda x: 2 - 2 * x # Gradient risin... Add solution -
Python 2021-09-14 19:34:01
torch import
import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader from torchvision import datasets, transforms, models from torchvision.utils import make_grid import numpy as np import pandas as pd from sklearn.me... Add solution -
Other 2021-09-13 23:04:02
how to plot a scatter plot in matplotlib
# Import matplotlib import matplotlib.pyplot as plt # Set plot space as inline for inline plots and qt for external plots %matplotlib inline # Set the figure size in inches plt.figure(figsize=(10,6)) plt.scatter(x, y, label = "label_name" ) ... Add solution