creating graph of distribution of blast hits on the query sequence
You probably want to include query start (qstart) and query end (qend) in your blast output.

Something like this:

blastn -query your.fasta -out blast.out.txt -db your.db -outfmt '6 qseqid sseqid qstart qend length evalue'


In R you can take the "qstart:qend" from each line for density plot.

There are many ways in R to plot the densities of these start and end amino acids.

Let me show an example with a small data frame:

qstart &lt;- c(200, 300, 250, 400, 500)
qend &lt;- c(300, 450, 400, 600, 650)

df &lt;- as.data.frame(cbind(qstart,qend))

aa &lt;- vector()
i=1
for(i in 1:5){
aa &lt;- append(aa, c(df[i,1]:df[i,2]))
i+1
}

hist(aa)
dens &lt;- density(aa)
plot(dens)