Text file data plotting

how to plot the data of text file . i want to plot one column vs other

Have a look at CSV.jl for reading the file.

You could try also:

using DelimitedFiles, Plots
file = raw"C:\Users\...\column_data.txt"
M = readdlm(file)
plot(M[:,1], M[:,2])

it is taking too much time . how to reduce data to plot

31 million points to plot is a lot.

Try plotting a few thousand first.
For ex:
plot(M[1:10_000:end, 1], M[1:10_000:end, 2])

Please try scatter plot:

scatter(M[1:10_000:end, 1], M[1:10_000:end, 2], ms=0.4)


how to use different color for different axes data ?

There is a number of posts on that topic in discourse, please see for example here or here.

You need to elaborate more about your requirements.

To make the question more precise: what does the data in the two columns of your matrix represent, and what do you expect your plot to look like?

3 Likes

This is data of astronomical object vela Pulsar . it contains two series of voltage data from north and south apertures respectively and also series number which represents time in perhaps microsecond scale. i want to plot these voltages with respect to time. i will also play with data.

Check if InspectDR is useful.
Read first the keybindings section to play with the plot.
You may display the two series versus times as follows (fake example):

using Plots; inspectdr()
N = 30_000_000
M = rand(-100.:100.,N,2)
ix = 1:10:N
t = (1:N)*1e-6
plot(t[ix], M[ix,1], xlabel="Time(s)")
plot!(t[ix], M[ix,2], xlabel="Time(s)")

NB: InspectDR copes relatively well with the full (2x) 30 million points but on my laptop the experience is better with up to ~ (2x) 3 million.

i have installed inspectdr but pluto is showing error even after restarting PC.
image

julia> import Pkg; Pkg.add(“InspectDR”)
Updating registry at ~/.julia/registries/General
Resolving package versions…
No Changes to ~/.julia/environments/v1.6/Project.toml
No Changes to ~/.julia/environments/v1.6/Manifest.toml

julia>

The questions on this post have been a bit of a moving target.

If staying within the comfort of Pluto is the requirement, the post is now tagged accordingly. Pluto users will advise on how to display and play with so many points.