# [SciPy-User] Plot Baseline Problem

3 messages
Open this post in threaded view
|

## [SciPy-User] Plot Baseline Problem

 I have attached code that I wrote to plot Infrared spectra. The x axis of the plot (attached) runs from 400 to 4000, which is the range of the infrared portion of the electromagnetic spectrum. The spectrum of the sample runs from 400 to 2800. My question is how can I expand the data plot from 2800 to 4000 (the intensity is 0.0 in that range)?  Of course this is not the case for each spectrum The only thing I've found via Google is https://stackoverflow.com/questions/47190853/extend-baseline-of-stem-plot-in-matplotlib-to-axis-limits. I appreciate your assistance. Thanks in advance. Stephen P. Molnar, Ph.D. Life is a fuzzy set www.molecular-modeling.net Stochastic and Multivariate (614)312-7528 (c) Skype: smolnar1 _______________________________________________ SciPy-User mailing list [hidden email] https://mail.python.org/mailman/listinfo/scipy-user InfraredPlots_44a.py (1007 bytes) Download Attachment 1.png (27K) Download Attachment
 If you append a (4000, 0) entry at the end of your data, your line will be expanded. Placing this after you read your data should do the trick: ```python data = np.concatenate((data, [[0, 4000]])) ``` Guillaume Le 09/10/2018 à 20:40, Stephen P. Molnar a écrit : ```I have attached code that I wrote to plot Infrared spectra. The x axis of the plot (attached) runs from 400 to 4000, which is the range of the infrared portion of the electromagnetic spectrum. The spectrum of the sample runs from 400 to 2800. My question is how can I expand the data plot from 2800 to 4000 (the intensity is 0.0 in that range)? Of course this is not the case for each spectrum The only thing I've found via Google is https://stackoverflow.com/questions/47190853/extend-baseline-of-stem-plot- in-matplotlib-to-axis-limits. I appreciate your assistance. Thanks in advance. Stephen P. Molnar, Ph.D. Life is a fuzzy set www.molecular-modeling.net Stochastic and Multivariate (614)312-7528 (c) Skype: smolnar1 ``` ```_______________________________________________ SciPy-User mailing list [hidden email] https://mail.python.org/mailman/listinfo/scipy-user ``` ```-- Guillaume Gay, PhD Morphgénie Logiciels SAS http://morphogenie.fr 12 rue Camoin Jeune 13004 Marseille +336 51 95 94 00``` _______________________________________________ SciPy-User mailing list [hidden email] https://mail.python.org/mailman/listinfo/scipy-user
 Many thanks for your reply. Appending, not just (4000, 0), but the (last xvalue of the curve 0.0). solved the problem. Stephen P. Molnar, Ph.D.                              Life is a fuzzy setwww.molecular-modeling.net                   Stochastic and Multivariate(614)312-7528 (c)Skype: smolnar1 From: SciPy-User On Behalf Of Guillaume GaySent: Tuesday, October 9, 2018 3:33 PMTo: [hidden email]Subject: Re: [SciPy-User] Plot Baseline Problem If you append a (4000, 0) entry at the end of your data, your line will be expanded.Placing this after you read your data should do the trick:```pythondata = np.concatenate((data, [[0, 4000]]))```GuillaumeLe 09/10/2018 à 20:40, Stephen P. Molnar a écrit :`I have attached code that I wrote to plot Infrared spectra. The x axis of``the plot (attached) runs from 400 to 4000, which is the range of the``infrared portion of the electromagnetic spectrum.`` ``The spectrum of the sample runs from 400 to 2800.`` ``My question is how can I expand the data plot from 2800 to 4000 (the``intensity is 0.0 in that range)?  Of course this is not the case for each``spectrum`` ``The only thing I've found via Google is``https://stackoverflow.com/questions/47190853/extend-baseline-of-stem-plot-``in-matplotlib-to-axis-limits.`` ``I appreciate your assistance.`` ``Thanks in advance.`` ``Stephen P. Molnar, Ph.D.        Life is a fuzzy set``www.molecular-modeling.net              Stochastic and Multivariate``(614)312-7528 (c)``Skype: smolnar1`` ``_______________________________________________``SciPy-User mailing list``[hidden email]``https://mail.python.org/mailman/listinfo/scipy-user``-- ``Guillaume Gay, PhD`` ``Morphgénie Logiciels SAS``http://morphogenie.fr`` ``12 rue Camoin Jeune``13004 Marseille`` `` +336 51 95 94 00`_______________________________________________ SciPy-User mailing list [hidden email] https://mail.python.org/mailman/listinfo/scipy-user