Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #4562

Re: plot quadratic equation graph

From Roedy Green <see_website@mindprod.com.invalid>
Newsgroups comp.lang.java.gui
Subject Re: plot quadratic equation graph
Date 2011-05-26 09:58 -0700
Organization Canadian Mind Products
Message-ID <eg1tt6t8jm10lu02mbloumpr8hmje8jk58@4ax.com> (permalink)
References <e00e980a-1a65-4564-b36f-f94f11d98ac2@j13g2000pro.googlegroups.com>

Show all headers | View raw


On Sat, 21 May 2011 22:12:12 -0700 (PDT), SamuelXiao
<foolsmart2005@gmail.com> wrote, quoted or indirectly quoted someone
who said :

>I am writing a japplet to plot the quadratic equation graph, that is,
>y=ax^2+bx+c.   I found jfreechart does not display negative x and y.
>
>Does anyone know how to do it? When I input a, b and c and press the
>plot button, the corresponding graph should be plotted with smooth
>line. For a,b,c and button part, I have done. Now just not know how to
>make the graph plotting.

If is fairly easy to use a Canvas/JPanel and drawString and drawLine
to handle a specific case like this.  You can hard code in the axis
locations, scale, position of the labels etc.
see http://mindprod.com/jgloss/canvas.html

The tricky part is creating generic components that adjust to draw all
manner of different graphs.

See http://mindprod.com/jgloss/graph.html
for some other packages you might try.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
How long did it take after the car was invented before owners understood 
cars would not work unless you regularly changed the oil and the tires?
We have gone 33 years and still it is rare to uncover a user who 
understands computers don't work without regular backups.

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Find similar


Thread

plot quadratic equation graph SamuelXiao <foolsmart2005@gmail.com> - 2011-05-21 22:12 -0700
  Re: plot quadratic equation graph "John B. Matthews" <nospam@nospam.invalid> - 2011-05-22 03:57 -0400
    Re: plot quadratic equation graph SamuelXiao <foolsmart2005@gmail.com> - 2011-05-28 07:20 -0700
      Re: plot quadratic equation graph "John B. Matthews" <nospam@nospam.invalid> - 2011-05-28 23:12 -0400
        Re: plot quadratic equation graph SamuelXiao <foolsmart2005@gmail.com> - 2011-05-29 06:40 -0700
          Re: plot quadratic equation graph "John B. Matthews" <nospam@nospam.invalid> - 2011-05-29 14:59 -0400
            Re: plot quadratic equation graph Lewis Bloch <lewisbloch@google.com> - 2011-06-20 09:06 -0700
  Re: plot quadratic equation graph Roedy Green <see_website@mindprod.com.invalid> - 2011-05-26 09:58 -0700

csiph-web