I would like to see the density of my data so I drew a contour plot using the data pre-processed by cut function, this is a small sample of my data:
> z[1:2,]
pc2_cut
pc1_cut (-1.61,-1.45] (-1.45,-1.3] (-1.3,-1.15] (-1.15,-1] (-1,-0.851]
(-1.58,-1.38] 0 1 1 0 0
(-1.38,-1.18] 5 1 4 1 0
I used plot3D library and,
> contour2D(z,border="black",xlab="PC1",ylab="PC2")
This is what I got:
You can see the x-axis and y-axis values are incorrect, not even near the midpoint of the intervals. Does anyone know how to correct this?

The
contour2D()function scales the axes between 0 and 1 by default. To get different axes you can omit axes from the originalcontour2D()call and add them usingaxis()withatandlabelsspecified. If you are using thefactorsfromcut()you will have to convert them to numeric values before plotting. I have provided an example below where I generate data, plot it, and then adjust the axes labels after converting the factors into numeric values. Without your exact data format I do not know the best way to extract tick mark labels from your data.