discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] plotting with python


From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] plotting with python
Date: Mon, 4 Jun 2012 08:06:45 -0400

On Mon, Jun 4, 2012 at 4:44 AM, ambily joseph <address@hidden> wrote:
> Sir
>
>
> I wanted to take float datas from a file sink and plot those values .
> I am using the below python script for this.
> I need to change my x -axis and y-axis limits.
> What command should i add to this script for this task?
>
> #!/usr/bin/env python
> from array import array
> import matplotlib.pyplot as plt
>
> input_file = open('mySID_output','r')
> float_array = array('d')
>
> float_array.fromstring(input_file.read())
>
> #print float_array
>
> plt.plot(float_array)
> plt.show()
>
> Thank you

You need to apply a set_xlim or set_ylim on the axes of the plot.
There should be a way to get the current axes after you've created the
plot. Generally, though, what I do is create a figure (plt.figure()),
create a subplot (add_subplot()) and use the subplot to plot and
manipulate the axes.

Tom



reply via email to

[Prev in Thread] Current Thread [Next in Thread]