Waléria Antunes David wrote:
Hello!!!

My name is Waleria. I work at INPE in Sao Jose dos Campos, Brazil. And I'd like to make a question. I'm in trouble to generate a two functions graph.

I have a problem to generate a graph of the two functions. I have this functions, is bellow:

*y1 = -108*(x**2)/(3e14**2)*

*y2 = 1*((1.38e-23*(1e0+4)/1e-6)*((x**2)/4*(1e4**2)*(3e14**2))))*

However, i need to plot a graph these two functions, the first function is 
decrescent an the second is crescent. I made some tests that cite below:


1 - I plotted only function at a time and the result was, the result of the 
first test is attached;
2- Then, I see the example below: http://matplotlib.sourceforge.net/examples/pylab_examples/set_and_get.html
So, I made a change in the example over, I changed the functions in the example 
and added my functions as falows below:

*from pylab import *

x = arange(3000,3400)

y1 = -108*(x**2)/(3e14**2)


y2 = 1*((1.38e-23*(1e0+4)/1e-6)*((x**2)/4*(1e4**2)*(3e14**2)))

lines = plot(x, y1, x, y2)*

However, the result in my opinion is incorrect, because the first function is 
decrescent and second is crescent, see the result of second test, is attached.


As can see in the image, first appers a continuous line and to ber a constant function should be of the type y=x for the example, the second function is crescent, ou seja, the first function is incorrect, i gave a print in the functions y1 and y2, the output values are correct, for function y1 the values are always decrescent and function(negative values) and for y2 the values are crescent ( positive values). As you can see in the image first appears a continuous line, and to be a constant function should be of the type y = x for example, the second function is increasing, ie, the first function is being displayed incorrectly.


Already relize tests using GNUPLOT and the results is equal to the tests over.

I would like to thank your support.
Best regards
Hello Waleria,

I'm not clear on what you are expecting to see in your plots.

I added print statements, for y1 and y2, to your code and the results are:

   * y1 min and max: -1.38638412e-20 -1.08e-20
   * y2 min and max: 1.39725e+27 1.7936343e+27

So your first plot appears to be correct.
Plotting y2 and y1, on the same (linear) figure will show y1 to be essentially zero because y2 is 27 orders of magnitude greater.

What am I misunderstanding?

-- jv
------------------------------------------------------------------------

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to