Hope this helps I will neglect the point about more than 30000 points as this is nonsense for printing. So assuming a configuration as implied by the code of some 3000 points or so, you can calculate the figure size needed to show the plot with one point per printable point. You would also need to make sure that the linewidth is actually one dot wide.
import numpy as np
Fs = 512
# Create random signal
data = [np.random.uniform(-10000, 20000) for i in range(5*Fs)]
import matplotlib.pyplot as plt
dpi = 600
figheight = 4 # inch, some constant number
margin_left = 1.0 # inch
margin_right = 0.4 # inch
figwidth = (len(data)/float(dpi)) + margin_left + margin_right # inch
plt.margins(x=0) # remove inner-axis padding of data
# use 72/dpi for linewidth such that one point is one dot
plt.plot(data, color = "black", linewidth = 72./dpi)
# note that show() may not make sense,
# since it readjusts the figure size to maximum screen size
will be helpful for those in need It's probably a trivial question, but I am trying to plot a bar chart with matplotlib and with rotated text on the x axis. The code I'm using is shown below: , Try calling plt.xlim() with the number of bins, e.g.
#make some data
N = 22
data = np.random.randint(1,10,N)
bin = np.arange(N)
width = 1
ax = plt.subplot(111)
ax.bar(bin, data, width, color='r')
around this issue Follow-up on my comment: The axis limits have changed. The image is in the rectangle between (0,0) and (500, 600). However the x- and y-lim are not exactly that; they range from (-100, -100) up to (500, 600). Just update the limits with ax.set_xlim([0, 500]) and ax.set_ylim([600, 0]) to remove the white frame around. Note: if you also want to hide the ticks you easily do this with ax.set_xticks() and ax.set_yticks(), or by setting the visibility of the ticks to False.
White space on top and bottom Python matplotlib plot
This might help you option 1: (CSS) The border-collapse property sets whether table borders should collapse into a single border or be separated as in standard HTML. The border-spacing property sets the distance between the borders of adjacent cells.