0

I am trying to plot an array created by one hot encoding for nucleotide sequences. the sequences were positive and negatives and I wish to change the color of scatterplot with two different colors. Not sure what goes wrong here

dim1 = pca_result[:,0]
dim2 = pca_result[:,1]
plt.figure(figsize=(10,10))
plt.scatter(dim1, dim2, cmap= 'YlGnBu' ,c=search_reg['NR+/-'], s=1)
plt.title("PCA for Negative data")
plt.xlabel('PCA 1')
plt.ylabel('PCA 2')
plt.show()

dim1 and dim 2 are arrays while the search_reg['NR+/-'] contains values of 0s and 1s. The graph plotted is in black and white but due to white background, its not clearly visible. How may I change the color of the graphs?

Kay
  • 90
  • 8
  • What are `dim1`, `dim2`, and `search_reg`? – Peter Leimbigler May 29 '19 at 00:01
  • 2
    Possible duplicate of [How to change background color for scatter plot in matplotlib](https://stackoverflow.com/questions/17989654/how-to-change-background-color-for-scatter-plot-in-matplotlib) – Mike May 29 '19 at 00:16

0 Answers0