5

Initiating the study on graphs and functions requires a lot of graphing to do. So I thought of downloading a utility for drawing graphs, but the software I did download had no option that would enable us to see plotted points. Ex: the best one I could find was Graph:

enter image description here

the documentation itself on how to use graph offers less information. I would atleast like to visualize the plotted points on the curve or find things like vertex, and other crucial informations without much effort through the utility. Are there any 'open source' software that would enable me to do so? Or is this a functionality hidden in the 'Graph'(software) that I am unaware of? I'm searching for windows(7) platform, it would be better if the software is open source or freeware, please mention the instructions on how the aforementioned features can be enabled?

5
  • Do you want to manually input points (scatter plot style) or do you want to enter an equation and get the program to show you some of the points on the function? Jun 1, 2016 at 11:13
  • @AndreaLazzarotto, yes that was exactly what I wanted to do(the latter one), get the program to show some of the points of the inputted function. The accepted answer's Geogebra is something that I liked but I don't know how to do this in it.
    – bzal
    Jun 4, 2016 at 9:30
  • Alright, answer provided. :) Jun 4, 2016 at 14:51
  • @AndreaLazzarotto, Thanks a tonne, but it seems a more command line interface which could take time to learn?
    – bzal
    Jun 5, 2016 at 11:29
  • Not exactly CLI only: i.imgur.com/Relr5q1.png Jun 5, 2016 at 13:45

3 Answers 3

4

IMHO other answers do not exactly target the question: they are more focused on suggesting (awesome) tools for plotting point-based data rather than symbolic functions.

I would at least like to visualize the plotted points on the curve or find things like vertex, and other crucial information without much effort through the utility. Are there any 'open source' software that would enable me to do so?

I suggest you try Sage. From the website:

SageMath is a free open-source mathematics software system licensed under the GPL. It builds on top of many existing open-source packages: NumPy, SciPy, matplotlib, Sympy, Maxima, GAP, FLINT, R and many more. Access their combined power through a common, Python-based language or directly via interfaces or wrappers.

Mission: Creating a viable free open source alternative to Magma, Maple, Mathematica and Matlab.

Sage is one of the best open source software suite for working with symbolic functions. It runs on Linux and OS X, but there is no native version for Windows. Windows users can download a pre-built virtual machine or use the web based Sage Math Cloud. Basic accounts with plenty of hardware resources are free of charge.

Plot a symbolic function

Assuming you want to plot:

example formula

Do:

f(x) = sin(x)*cos(x/pi)
plot(f, (x, -5, 5))

You will get this output:

example of basic output

Note: if you want to use other symbolic variables, you need to define them first, because only x is built-in. For example:

var('y z a b c d')

Let Sage show you some points

If you want to let Sage sample some points, you can do like this:

from sage.plot.plot import generate_plot_points

f(x) = sin(x)*cos(x/pi)
g = plot(f, (x, -5, 5))
points = generate_plot_points(f, (x, -5, 5))
h = line(points, markerfacecolor='gray', marker='o', markeredgewidth=0, linestyle="")

g+h

example of points chosen by Sage

Note that these points might not be all of those used to draw the complete plot. You can increase the depth of the adaptive algorithm with a couple of parameters.

Pick exactly the plotted points

You can also hack into the g object to get the first (and only) primitive (of type Line) and access the data:

f(x) = sin(x)*cos(x/pi)
g = plot(f, (x, -5, 5))
l = g[0]
points = zip(l.xdata, l.ydata)
h = line(points, markerfacecolor='gray', marker='o', markeredgewidth=0, linestyle="")

g+h

example of all points used in the plot

Woah, that's a lot of points. :D

Decide where to place the points

Another approach is to place the points where you want. For example, you might want to plot a point every 0.5 units on the x-axis:

f(x) = sin(x)*cos(x/pi)
g = plot(f, (x, -5, 5))
points = [(x, f(x)) for x in srange(-5, 5.1, 0.5)]
h = line(points, markerfacecolor='gray', marker='o', markeredgewidth=0, linestyle="")

g+h

points chosen at fixed intervals

More options

You can get much fancier by:

  • changing colors, line thickness, type of marker and so on
  • add a text object to each point with coordinates
  • set ymin and ymax limits to the plot in order to draw functions with very high values

Possibilities are endless.

Check out the following links:

Save the plot

One more thing. If you want to save the figure, just call the save method on any plot object.

For example:

g.save("nice.png")
(g+h).save("wonderful.pdf")
3

If you are just playing about with graphing you can't go much wrong using Gnuplot.

  • Free - Gratis & Open Source
  • Small & Portable
  • Cross Platform Linux, OS/2, MS Windows, OSX, VMS, and many other platforms
  • interactive screen display: cross-platform (Qt, wxWidgets, x11) or system-specific (MS Windows, OS/2)
  • direct output to file: postscript (including eps), pdf, png, gif, jpeg, LaTeX, metafont, emf, svg, ...
  • mouseable web display formats: HTML5, svg
  • Just about every plot you can think of including scatter, histogram, 3D

From the site

set samples 20
set isosamples 21
set xlabel "X axis"
set ylabel "Y axis"
set zlabel "Z " offset 1, 0
set view 60, 30, 0.85, 1.1
set key at screen 1.0, 0.9
set style textbox opaque noborder margins 0.5, 0.5

set title "contour plot"
set contour
splot x*y

enter image description here

You can also look at:

  • ipython/jupyter + matplotlib which will let you create plots in python from within a browser window, vary parameter, etc., and produce publication quality documentation. Free, open source & cross platform

enter image description here

  • R/jupyter does the same for the R statistical programming language Free, open source & cross platform

Lastly take a look at plot.ly where you can generate plots in any of a number of manners, (chargeable for private plots).

3

You can use GeoGebra:

enter image description here

2
  • it's got a similar interface to Graph
    – bzal
    May 29, 2016 at 6:59
  • rather that entering points on a graph(only 2D for my case), how do we make the points in an entered equation visible. For instance, for the equation of straight line: 8x + 3y = 5, one of the point that satisfy the equation may be: (1, -1), how do we make such points visible on the line in the graph?
    – bzal
    May 30, 2016 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.