This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to draw graph from dataset file in python by matplotlib?

It is not related with R? Can anyone help me how to draw graph from dataset file in python by matplotlib?

python

It is not related with R?

Why tag R then? You clearly state in the title that you want to draw a graph with python and matplotlib module.

What type of graph? What does your data look like? This is very limited information, and there are some pretty basic tutorials.

Simple graph, how will I open the file to plot a graph?

There are several ways. What type of format is your file? Post an example.

co2a0000364.rd

120 trials, 64 chans, 416 samples 368 post_stim samples

3.906000 msecs uV

S1 obj , trial 2

FP1 chan 0

2 FP1 0 9.064
2 FP1 1 6.622
2 FP1 2 4.669
2 FP1 3 3.693
2 FP1 4 3.693
2 FP1 5 3.693
2 FP1 6 4.181
2 FP1 7 4.181
2 FP1 8 5.157
2 FP1 9 6.134
2 FP1 10 7.111
2 FP1 11 7.111
2 FP1 12 5.646
2 FP1 13 4.669
2 FP1 14 3.693
2 FP1 15 4.181
2 FP1 16 4.669

Please reformat with 101010 button.

sorry sir I'm not getting I have to open simple file and plot a graph

This is not a bioinformatics question, and likely will be closed by a moderator. You're probably best off, asking your question on StackOverflow.

Agree, although I would recommend adding A LOT of information to this question before asking it anywhere else.

Hello Ssonia!

We believe that this post does not fit the main topic of this site.

Not related to bioinformatics and question really unclear

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

1 answer

It's massively not clear what you want to do, but plotting with matplotlib is as easy as passing 2 vectors of numbers.

# Generate some sample data
import random 
x = random.sample(xrange(1,101), 100)
y = random.sample(xrange(1,101), 100)

# Make plot
import matplotlib.pyplot as plt
plot = plt.plot(x,y, "o")
plt.show()

Makes:

enter image description here

Log in to answer this question.