How can I modify the above code to create what I want. Norm = colors.BoundaryNorm(bounds, cmap.N)Īx.grid(which='major', axis='both', linestyle='-', color='k', linewidth=2)Īlthough my intention is to generate a grid of size m x m (where m is sqrt(len(n)), I want to start by making a static sized grid. Will then show on a plot the primes vs all numbers in range n.Ĭmap = colors.ListedColormap() """ Returns a list of primes 2 and produces a list of all primes up to n. Generating list of primes def all_prime(n): All the way up to 1,000,000 My code so far: What it should look like is a large grid displaying numbers 0-1,000,000 and blackening any square where a prime is (so on the first and second square it is white (0 and 1) and the third and fourth square is black (2 and 3), etc). I'm working on plotting a 1,000 x 1,000 grid where a white square represents a non-prime number, and a black square represents a prime number.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |