What do you want to save?
Add Code snippet
New code examples
-
Python 2021-11-21 19:03:18
python plot a dictionary
# credit to the Stack Overflow user in the source link import matplotlib.pylab as plt lists = sorted(d.items()) # sorted by key, return a list of tuples x, y = zip(*lists) # unpack a list of pairs into two tuples plt.plot(x, y) plt.show() Add solution -
Python 2021-11-21 03:29:22
arduino python matplotlib line
import serial # import Serial Library import numpy # Import numpy import matplotlib.pyplot as plt #import matplotlib library from drawnow import * tempF= [] pressure=[] arduinoData = serial.Serial('com11', 115200) #Creating our serial ob... Add solution -
Python 2021-11-19 13:36:21
python how to save a Seaborn plot into a file
# Basic syntax: plt.savefig("output.png") # Example usage: plt.figure() plt.plot(range(5)) plt.savefig("output.png", dpi=300) # Note, savefig comes from matplotlib.pyplot and plt is an # abbreviation for this, e.g. import matplotli... Add solution -
Python 2021-11-17 14:42:20
python plot legend
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-11-17 10:43:09
pyplot savefig
import matplotlib.pyplot as plt # creating plotting data xaxis, yaxis =[1, 4, 9, 16, 25, 36, 49, 64, 81, 100], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] # plotting plt.plot(xaxis, yaxis) # saving the file.Make sure you # use savefig() before show(). plt.... Add solution -
Python 2021-11-16 14:18:31
plt.legend(
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-11-16 05:52:28
python matplotlib hist set axis range
# Basic syntax: plt.ylim(min,max) plt.xlim(min,max) # Example usage: import matplotlib.pyplot as plt plt.plot(range(5)) plt.xlim(-5, 5) plt.ylim(-5, 5) # Note, this approach is more versatile than using range=[min,max] which # only works in some plots,... Add solution -
Python 2021-11-14 21:26:20
plotting graphs in keras
# Visualize training history from keras.models import Sequential from keras.layers import Dense import matplotlib.pyplot as plt import numpy # load pima indians dataset dataset = numpy.loadtxt("pima-indians-diabetes.csv", delimiter=","... Add solution