简体   繁体   中英

Graphs on Python as plt.plot wont show

Hello i've been stuck on this for a while now. My graph wont show i'm unsure if its because of my while loop:

while True:
   temperature = input("Temperature in Kelvin. Type stop to finish")

   if temperature == "stop":
    break

   else:
     tempy = float(temperature)

   print (tempy)

and my plot:

  intensities=rad(lambda_range_metres,root_mean_square_dev)
# Plot the intensity values against the wavelength in millimetres
  plt.plot(lambda_range,intensities)
  plt.title('i')
  plt.xlabel('i /i ')
  plt.ylabel('i / i')
  plt.show()

I'm not sure where i'm going wrong with this. Thank you

Your loop surely has nothing to do with a problem. Checkout the link , there are multiple possible ways to solve your problem. You can also try saving your figure with plt.savefig('myfig.png') . If successful, then it's most probably the backend problem as suggested in the selected answer to the referenced question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM