Need to Make a Graph--Thought it Would be Easier

Sluggo63

Pattern Altitude
Joined
Oct 9, 2013
Messages
1,927
Display Name

Display name:
Sluggo63
Do you remember in grade school when you were learning about graphs, and your homework was a set of ordered pairs (x,y) and you'd have to plot them on graph paper and when you connected the dots, you would have a picture of a dinosaur or star or even an airplane...

four-quad-graphing-puzzle.png.pagespeed.ce.QgrxMh06lH.png


Well, I'm trying to create a graph of ordered pairs on my laptop suitable for printing and laminating.

The ordered pairs define the corners of a polygon, and I'd like some software to be able to input the x- and y-coordinates and have it output the graph. I can not find anything that does what I'm looking for. Excel doesn't work (at least in my limited Excel scope).

Obviously, I can graph them by hand, and already have, but I want something more "professional."

Any ideas?
 
x,y chart in libre office - excel would be similar. "add series" to chart to add additional polygons
upload_2022-5-1_17-52-7.png


???
 
That's a tough one. My thought is you would need to get in to vector equations, e.g. CAD algorithms, but that isn't happening on a spreadsheet, certainly not easily. I don't have an easy answer. Or a hard one either, it's been egons since I dealt with that stuff in UG calculus.
 
I think I just invented a new word!
 
Almost any other graphing solution other than Excel or Libre Office isn't likely to be inexpensive. I use OriginLab at work and it costs around $1000
The suggestions above would work. Have you considered the LOGO programming language? You can program a "turtle" to trace the shape.
 
Do you know python or want to learn it? There's a freee graphics package "graphics.py" that will do this. I had my freshman CS students learn it to do simple animations. Easy to use but you need to know python. Another option is FreeCAD - for all 3 platforms - windows, mac & linux.
 
Matplotlib, which is a python library. Create a script something like this:
------------
import matplotlib.pyplot as plt

seq1 = [[-3,0],[-4,-1],[-6,-2],[-6,-3],[-5,-4],[-4,-4],[-3,-4],[1,-2]]
seq2 = [[-1,1],[5,3],[6,5],[7,5],[7,3],[9,2],[8,1.5],[6,2],[2,-0.5]]
## .....and the rest of them......

for s in [seq1, seq2]:
x1 = []
y1 = []
for i in s:
x1.append(i[0])
y1.append(i[1])​
plt.plot(x1,y1,'r-')​

plt.show()
---------------
...and run it. Here are the first two segments......
You can of course add things like axis labels, grid lines, etc. etc....
airplane.png

A Mac should come with python already installed. In which case you say "pip install matplotlib" to get matplotlib too. Then run a script like the one above. Not sure about PC's.

Edit: you could also configure the script to collect your [x,y] pairs from the command line, or read them from a file. Python is very versatile.
 
Last edited:
Wow. Very cool stuff. Thanks everyone…

Looks like this simple graph is turning into me learning Python…
 
Oh, let’s make it more complicated….macs come with python2 unless things have changed in the past few years, which means you need tomupgrade to python3 and pip3, too.

Never mind….

Didn’t know about matplotlib….I need to go get it, thanks!

Windows people..just go to python.org and download python.
 
x,y chart in libre office - excel would be similar. "add series" to chart to add additional polygons
View attachment 106516


???
upload_2022-5-2_13-29-30.png

X,Y plot in Excel did the trick. I didn't know it would connect the different x,y values. That was handy, thanks.

It's not exactly what I wanted (I wanted each section to be shaded), but it'll do the trick.

I think I still may have a look at learning Python, though. Seems useful.
 
Back
Top