Trying to read from a text file to generate a graph

Cameron Simpson cs at cskk.id.au
Wed Jul 28 04:25:18 EDT 2021


On 28Jul2021 02:55, Steve <Gronicus at SGA.Ninja> wrote:
>I am going though a struggle with this and just don't see where it fails.
>I am using the Dual Bar Graph.py program from https://matplotlib.org/stable/gallery/index.html website.
>The file from the web site works so that shows that all my installations are complete.
>
>My program, LibreGraphics 05.py program runs but the graph is all smutched up.  I am pulling data from the EXCEL-FILE.txt into the program, selecting three values for each line and creating three variables formatted as is shown in the original demo file.
>
>When you run the program, choose 112 when prompted. You will see the values of the variables I want to pass to the graph section of the code.  If the values are hardcoded, the graphs look good.  When the variables generated by my section of the code, it does not.
>
>I am not sure what more to explain.
>Please help me....
>Steve
>
>I am attaching a zip file.  I hope it gets through.

Alas, the python-list is text only, and attachments are discarded.

Is your programme small enough (one file, not insanely long) to just 
include inline in your next message?

Have you printed the variables generated by your code? _Are_ they the 
same as the hardcoded values? You may want to graph different stuff, but 
start by trying to exactly reproduce the hardcoded value, but extracted 
from the file.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Python-list mailing list