Help needed to fill_between two curves

Dear Sir/Madam,

                   I am plotting with matplotlib using two data files with
different x and y ranges. I need to fill up the region between the two
curves. I request you to kindly help me in this regard. I am attaching the
files with
this e-mail. the plot range should be between x->0.93 to 1.0 and y->0 to
0.25.

Thanking you,
Sincerely,
akhliesh

···

--
***********************************************************************************************
* Dr. Akhilesh Nautiyal
* Assistant Professor
* Department of Physics
* Malaviya National Institute of Technology Jaipur
* JLN Marg Jaipur-302017
* Mo: +91-9 <%2B91-9445520847>549657939
***********************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180524/32cb6ce8/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ns_r_N_46.dat
Type: application/octet-stream
Size: 8770 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180524/32cb6ce8/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ns_r_N_55.dat
Type: application/octet-stream
Size: 10149 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180524/32cb6ce8/attachment-0003.obj>

Hi Akhliesh,

For basic usage of Matpolotlib, the following tutorials may be good
starting points:
   * https://matplotlib.org/tutorials/introductory/pyplot.html
   * https://matplotlib.org/tutorials/introductory/usage.html
To enforce peculiar x- and y-ranges, I think that you may want to use
`ax.set_xlim` and `ax.set_ylim` (or `plt.xlim` and `plt.ylim` if you
prefer the interactive Pyplot interface rather than the object-oriented
one).

Besides, you may find the following example useful:
https://matplotlib.org/gallery/lines_bars_and_markers/fill_between_demo.html
to learn how to fill the aerea between 2 curves.

Hopefully this will help you a bit.

Best regards,
Adrien

···

On 05/24/2018 05:13 AM, Akhilesh Nautiyal wrote:

Dear Sir/Madam,

? ? ? ? ? ? ? ? ? ?I am plotting with matplotlib using two data files
with different x and y ranges. I need to fill up the region between the
two curves. I request you to kindly help me in this regard. I am
attaching the files with
this e-mail. the plot range should be between x->0.93 to 1.0 and y->0 to
0.25.

Thanking you,
Sincerely,
akhliesh

--
***********************************************************************************************
* ? ?Dr. Akhilesh Nautiyal
*?? Assistant Professor
*?? Department of Physics
* ? Malaviya National Institute of Technology Jaipur
* ? JLN Marg Jaipur-302017
* ?? Mo: +91-9 <tel:%2B91-9445520847>549657939
***********************************************************************************************

This body part will be downloaded on demand.

Dear Adrien,

         Thanks for the reply. I have tried all that. Actually in my case
the two curves have different size of abscissa and ordinates. Suppose I
make arrays like x1, y1 and x2, y2 from two data files
attached in my previous mail, the arrays x1 and x2 have different size and
the arrays y1 and y2 have different size.
I will be grateful if you can help me how to fill the area between these
curves n this particular case.

With Regards,
akhilesh

···

On Thu, May 24, 2018 at 10:24 PM, vincent.adrien at gmail.com < vincent.adrien at gmail.com> wrote:

Hi Akhliesh,

For basic usage of Matpolotlib, the following tutorials may be good
starting points:
  * https://matplotlib.org/tutorials/introductory/pyplot.html
  * https://matplotlib.org/tutorials/introductory/usage.html
To enforce peculiar x- and y-ranges, I think that you may want to use
`ax.set_xlim` and `ax.set_ylim` (or `plt.xlim` and `plt.ylim` if you prefer
the interactive Pyplot interface rather than the object-oriented one).

Besides, you may find the following example useful:
https://matplotlib.org/gallery/lines_bars_and_markers/fill_
between_demo.html
to learn how to fill the aerea between 2 curves.

Hopefully this will help you a bit.

Best regards,
Adrien

On 05/24/2018 05:13 AM, Akhilesh Nautiyal wrote:

Dear Sir/Madam,

                    I am plotting with matplotlib using two data files
with different x and y ranges. I need to fill up the region between the two
curves. I request you to kindly help me in this regard. I am attaching the
files with
this e-mail. the plot range should be between x->0.93 to 1.0 and y->0 to
0.25.

Thanking you,
Sincerely,
akhliesh

--
************************************************************
***********************************
* Dr. Akhilesh Nautiyal
* Assistant Professor
* Department of Physics
* Malaviya National Institute of Technology Jaipur
* JLN Marg Jaipur-302017
* Mo: +91-9 <tel:%2B91-9445520847>549657939
************************************************************
***********************************

This body part will be downloaded on demand.

--
***********************************************************************************************
* Dr. Akhilesh Nautiyal
* Assistant Professor
* Department of Physics
* Malaviya National Institute of Technology Jaipur
* JLN Marg Jaipur-302017
* Mo: +91-9 <%2B91-9445520847>549657939
***********************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180525/c08bbc47/attachment.html>

Hi Akhilesh,

Then I guess that you need to somehow interpolate your data to share the
same abscissa values, at least for the ?fill between? step. I am not
very used to do this kind of things but please find attached a script
that may be helpful to you (it produces to attached PNG, with Matplotlib
2.2). It uses Numpy to perform linear interpolation of your data;
scipy.interpolate may also be a good source of interpolation tools if
this is not good enough for you.

Best,
Adrien

PS : I also reattach the data files, to make it easier to play with the
script if somebody else wanted to propose a better solution.

Dear Adrien,

? ? ? ? ?Thanks for the reply. I have tried all that. Actually in my
case the two? curves have different size of abscissa and ordinates.
Suppose I make arrays like x1, y1 and x2, y2 from two data files
attached in my previous mail, the arrays x1 and x2 have different size
and the arrays y1 and y2 have different size.
I will be grateful if you can help me how to fill the area between these
curves n this particular case.

With Regards,
akhilesh

    Hi Akhliesh,

    For basic usage of Matpolotlib, the following tutorials may be good
    starting points:
     ? * https://matplotlib.org/tutorials/introductory/pyplot.html
    <https://matplotlib.org/tutorials/introductory/pyplot.html>
     ? * https://matplotlib.org/tutorials/introductory/usage.html
    <https://matplotlib.org/tutorials/introductory/usage.html>
    To enforce peculiar x- and y-ranges, I think that you may want to
    use `ax.set_xlim` and `ax.set_ylim` (or `plt.xlim` and `plt.ylim` if
    you prefer the interactive Pyplot interface rather than the
    object-oriented one).

    Besides, you may find the following example useful:
    https://matplotlib.org/gallery/lines_bars_and_markers/fill_between_demo.html
    <https://matplotlib.org/gallery/lines_bars_and_markers/fill_between_demo.html>
    to learn how to fill the aerea between 2 curves.

    Hopefully this will help you a bit.

    Best regards,
    Adrien

        Dear Sir/Madam,

         ?? ? ? ? ? ? ? ? ? ?I am plotting with matplotlib using two
        data files with different x and y ranges. I need to fill up the
        region between the two curves. I request you to kindly help me
        in this regard. I am attaching the files with
        this e-mail. the plot range should be between x->0.93 to 1.0 and
        y->0 to 0.25.

        Thanking you,
        Sincerely,
        akhliesh

        --
        ***********************************************************************************************
        * ? ?Dr. Akhilesh Nautiyal
        *?? Assistant Professor
        *?? Department of Physics
        * ? Malaviya National Institute of Technology Jaipur
        * ? JLN Marg Jaipur-302017
        * ?? Mo: +91-9 <tel:%2B91-9445520847>549657939
        ***********************************************************************************************

        This body part will be downloaded on demand.

--
***********************************************************************************************
* ? ?Dr. Akhilesh Nautiyal
*?? Assistant Professor
*?? Department of Physics
* ? Malaviya National Institute of Technology Jaipur
* ? JLN Marg Jaipur-302017
* ?? Mo: +91-9 <tel:%2B91-9445520847>549657939
***********************************************************************************************

-------------- next part --------------
A non-text attachment was scrubbed...
Name: example_akhilesh.py
Type: text/x-python
Size: 1417 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180525/0ebe9dba/attachment-0001.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example_akhilesh.png
Type: image/png
Size: 27223 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180525/0ebe9dba/attachment-0001.png>
-------------- next part --------------
0.7777649027439225 0.00010299728721798685
0.778534888413173 0.00010642666300056307
0.7793008628601412 0.00010995020519029702
0.7808208874071819 0.00011728764856451117
0.7815749915663855 0.00012110554036633412
0.782325192626475 0.00012502557970165977
0.7838139909765232 0.0001331803481720669
0.7845526404533767 0.0001374192609951405
0.7852874912095886 0.00014176868856181454
0.7867458984466191 0.00015080771781858767
0.7896182366974104 0.00017030820338468077
0.79032719887478 0.00017549279705574011
0.7910325604471398 0.00018080577507010817
0.7924325768110586 0.00019182625785632722
0.7951904362852443 0.0002155122050792516
0.7958712489557411 0.0002217905871218254
0.7965486458710345 0.0002282166799403028
0.797893281148427 0.0002415220746601718
0.8005425279823185 0.00027001740861596496
0.8011966264537461 0.0002775490338820485
0.8018474817772919 0.0002852490601231336
0.8031395458564915 0.0003011650405675561
0.8056856581797209 0.0003351368484593093
0.8063143831517847 0.00034409167834795586
0.8069400262773251 0.00035323684296021464
0.8081821444723657 0.00037210948195553426
0.810630242063823 0.0004122640658221719
0.8112348468417727 0.0004228215175729612
0.8118365206270748 0.0004335923361829363
0.8130311477188241 0.0004557858807428975
0.8153860191961073 0.0005028640231440689
0.8159676763076312 0.000515211729054082
0.8165465436210292 0.0005277967650512714
0.8176959767427735 0.0005536910457116875
0.8199621045274258 0.0006084625803755528
0.8205688783677255 0.0006240124493479633
0.8211725303705313 0.0006398706023735845
0.8223705498355804 0.0006725277346842233
0.8247300076332486 0.0007417177098466896
0.8253123650630758 0.0007598461703585147
0.8258917581154859 0.0007783151168970895
0.8270417266320703 0.0008162907224618817
0.8293069131304805 0.0008965068685443686
0.8298660765176573 0.0009174732507137566
0.8304224224909986 0.0009388127495713375
0.8315267327469041 0.0009826274686283668
0.8337023120786754 0.0010749144041535892
0.8379250706331431 0.0012790335966513188
0.8384411955539658 0.0013064602630736537
0.8389547687849435 0.0013343252676645786
0.8399743219030351 0.001391386395008962
0.8419834798329024 0.0015109452775087402
0.8424796172072151 0.0015419908623625356
0.8429733231262315 0.0015735067087677024
0.8439534984288661 0.0016379649081388812
0.8458853012488958 0.0017726965345528317
0.8463623861688996 0.0018076135069004969
0.8468371523316116 0.0018430317707915757
0.8477797826275683 0.001915387354940656
0.8496378088490358 0.002066279900828453
0.853247827397222 0.0023936133892203454
0.853660188807904 0.002434103040962055
0.8540707067298408 0.00247508025252723
0.8548862511264194 0.00255850848788272
0.8564956434112792 0.0027313369244032384
0.8568935266878274 0.002775803916000391
0.8572896427444043 0.002820780159827517
0.8580766100714385 0.002912270814487526
0.8596297401249036 0.0031014763044270857
0.8600137406445666 0.0031500889899996466
0.8603960460507769 0.003199231108081076
0.8611556064065393 0.0032991132487937154
0.862654766161712 0.003505334907692507
0.8655751205219364 0.003944110761875947
0.865933015048348 0.004001468145286187
0.8662893473639566 0.004059390190518583
0.8669973566834337 0.004176936064340147
0.868394970459068 0.0044188878343903336
0.8711182679362534 0.004930628654503342
0.8714520802172682 0.0049972382841679186
0.8717844498434613 0.005064440177652245
0.8724448893738104 0.005200626544731414
0.8737487647669581 0.005480168291477531
0.8762900265374215 0.006068209689628644
0.8765954820701777 0.006142950330626754
0.8768996546832621 0.006218278786798908
0.8775041752538003 0.006370702601249869
0.8786980845073213 0.006682640290368173
0.881026680304881 0.007335029313740957
0.8813123137805693 0.007419262167315135
0.8815967567596672 0.0075040930440074495
0.882162093182373 0.0076755503272223705
0.8832787198255495 0.008025655497444275
0.885456978386095 0.008754670165084683
0.8857242063939582 0.008848498805261229
0.8859903282265861 0.008942927730228402
0.8865192734360914 0.009133585930948158
0.8875641089914412 0.009522098529006734
0.889602649932043 0.010327841897363658
0.8934835837341364 0.012053278292409151
0.893737582465146 0.012175701967128996
0.8939904542701391 0.012298810496481315
0.894492838705263 0.01254707683512872
0.8954843204353634 0.01305176764638926
0.8974153074682911 0.014093440636015432
0.8976519080277009 0.014226644888024158
0.8978874647273882 0.01436050883523896
0.8983554663444109 0.01463020836149866
0.8992791595525931 0.015177440008979318
0.9010783810870651 0.01630277666922027
0.9012988600848018 0.016446296189366057
0.9015183714388144 0.016590442082491132
0.9019545094066513 0.01688060365459143
0.9028153724026475 0.01746833912249649
0.9044924354929038 0.018672903306015592
0.9076755244158464 0.021193638460084555
0.9078544210433944 0.021345078660284983
0.9080325919936781 0.021496989484307106
0.908386769435657 0.02180221313806189
0.9090865536858938 0.022418198701231455
0.9104525252982896 0.02367175469489287
0.9130553812836999 0.026260518535110022
0.9132125476639876 0.02642574101424769
0.9133690822260596 0.026591349991580596
0.9136802667566558 0.026923716361370205
0.9142951727893507 0.02759296487239111
0.9154957254433618 0.02894889739566586
0.9177843786930225 0.031725427880303886
0.9179341652186026 0.031916386383745034
0.9180833053155302 0.032107692011051965
0.9183796581960538 0.03249133001124663
0.9189647377112328 0.033262610596720275
0.9201050440010922 0.0348203713317557
0.9222712803827299 0.03799016585474537
0.9224017988562213 0.03819042443107683
0.9225317600187741 0.03839091398844474
0.9227900206840374 0.038792571795979974
0.923299966604774 0.03959850278306335
0.9242941165842453 0.041220036797912786
0.9261837711360066 0.04449558243660411
0.9262955995433069 0.04469774436357472
0.926406964481816 0.04490002274134918
0.926628312302201 0.04530491639762481
0.9270655376225101 0.046115964712408995
0.9279185622190063 0.04774242122084563
0.9295424246051323 0.05100744681724717
0.9324876591698652 0.0575458613542144
0.932567891629777 0.057735965458793344
0.9326478215820904 0.05792601772740559
0.9328067789940242 0.05830595916185916
0.9331211187526971 0.05906513702385775
0.9337357727394826 0.060580260498656585
0.9349111061036649 0.06359441776369323
0.9370618274929104 0.06953527666513784
0.9371303441976264 0.06973411667655945
0.9371985881475118 0.06993277658688651
0.9373342626315764 0.07032954971048683
0.9376023915592556 0.07112086515693776
0.9381260335169028 0.07269423181247296
0.9391248946939715 0.07580135389999199
0.9409441472797399 0.08183939446813575
0.9437953928798332 0.09239458772604517
0.9460340054277968 0.10174499263964984
0.9479805671855708 0.11074547984309428
0.9494440757999822 0.11810845541086937
0.9507309348798171 0.12504784758546283
0.9517563046144303 0.13091432115797763
0.9525445927357128 0.13564157238236288
0.9532534796389293 0.14006297235390838
0.9538045838576086 0.14361682931868408
0.9543046317647983 0.14693320750152303
0.9547157983871705 0.14972771242261054
0.9550411628681701 0.15198352970102763
0.955341707882793 0.15410301471803065
0.9555816083965647 0.15581995999699597
0.9557849525868717 0.15729305104246002
0.9559756214216941 0.15868935457906688
0.9561298517236254 0.15982959630331486
0.9562752262636938 0.16091329875654214
0.9563992714615974 0.16184492306218917
0.9565007796512103 0.16261207051489773
0.9565976251761754 0.16334802468759338
0.9566773324552645 0.16395672360767785
0.9567468090776797 0.16448950400191703
0.9568137842759892 0.16500506067225904
0.9568693996312279 0.1654346401325758
0.9569231734537543 0.16585126703796688
0.9569680344863356 0.1661997998655588
0.957007615954876 0.16650804251632434
0.9570462157072535 0.16680929891427695
0.9570786503693186 0.16706294351760667
0.957110349168441 0.1673112797035159
0.9571383849633606 0.16753128736241749
0.9571620956733499 0.1677176248229922
0.9571854383087164 0.1679013121639535
0.9572052469505404 0.1680573789075401
0.9572230025692644 0.16819741816949874
0.9572405958954725 0.16833631533776527
0.957255603470907 0.16845490694844337
0.9572558540102493 0.168456887588968
0.9572561041781625 0.16845886532100193
0.9572566034023409 0.16846281207996663
0.9572575974225008 0.1684706709194907
0.9572595678960633 0.16848625101237727
0.9572634397264728 0.16851686973758218
0.9572636787008129 0.16851875978305417
0.9572639173241839 0.16852064707806214
0.9572643935204885 0.168524413435779
0.9572653417285698 0.16853191335513282
0.9572672215433351 0.16854678306645896
0.9572674549756102 0.1685486296722525
0.9572676880666519 0.16855047360285302
0.9572681532274255 0.16855415345696448
0.9572690794804001 0.1685614812657372
0.9572693101994824 0.16856330659896
0.9572695405820808 0.168565129293729
0.9572700003401783 0.16856876678610094
0.9572702297168503 0.168570581592779
0.9572704587593843 0.1685723937791533
0.957270687468364 0.1685742033497388
0.9572709158443715 0.16857601030904143
-------------- next part --------------
0.7777757357684436 0.000016335999618040326
0.7785460686329915 0.000016988019701830734
0.7793123992698467 0.000017662262919540527
0.7808331638548643 0.000019079886255473243
0.781587652203127 0.000019824530940487907
0.782338247128761 0.000020593928127496754
0.7838278629373382 0.000022209647249467747
0.7845669363596988 0.000023057334768970906
0.7853022214429008 0.00002393250617856618
0.786761529198422 0.000025768174818545244
0.7896358010573459 0.000029801677639463424
0.7903452753355482 0.00003089000770344715
0.7910511608632793 0.000032011917940761335
0.7924522614607283 0.00003435978617943431
0.7931475239192247 0.000035587432680385596
0.7938392924088281 0.000036852036514820314
0.7952124400672305 0.00003949564835180881
0.7958938650408303 0.00004087645808122218
0.7965718876589778 0.00004229782873596111
0.7979178153319364 0.00004526601456272042
0.8005698164959005 0.000051731311280843844
0.8012246400415597 0.00005346365468535062
0.8018762354402714 0.000055244462373369554
0.8031698254859825 0.00005895570233515126
0.8038118615435857 0.000060888287685843135
0.8044507522787983 0.00006287364353503569
0.8057191787297855 0.00006700713722534954
0.8063487545019494 0.00006915754778114847
0.8069752650677027 0.00007136527429801587
0.8082191688902329 0.00007595738581555366
0.8106710465240436 0.0000858820588726138
0.8112766410197801 0.00008852470793867714
0.8118793228208372 0.0000912344849545665
0.8130760216681219 0.00009686061400529349
0.8154352653576341 0.00010897634665808654
0.8160180643756256 0.00011219308860916741
0.8165980935498055 0.00011548772814828982
0.8177499110793256 0.00012231636591281808
0.8200210561634186 0.0001369715549512006
0.820629248228901 0.00014118230704598424
0.8212343438500033 0.00014549852535503474
0.8224353277575863 0.00015445517823505287
0.8248010303919069 0.00017372115485053607
0.8253850163257151 0.0001788313042633412
0.8259660652995626 0.00018406305349991868
0.8271194288995094 0.00019489977487906066
0.8293917453592554 0.00021812608618046827
0.8299527634320777 0.00022426888062946476
0.8305109934440166 0.0002305505864497117
0.8316191607711516 0.00024353971766118525
0.8338028166593698 0.0002712846796845614
0.834342023344378 0.00027860246626665026
0.8348785810931848 0.0002860775568577737
0.8359438166066415 0.0003015091425345411
0.8380432277235448 0.000334365193982153
0.8385617039418687 0.0003430085673240129
0.8390776613173992 0.0003518285999155786
0.8401020820559864 0.0003700085771300069
0.8421213779339637 0.00040859840982242354
0.8426201347816739 0.0004187251947575634
0.8431164945307418 0.00042904881893442604
0.8441020812644973 0.0004502968870074472
0.8460451267714436 0.0004952689675215598
0.8465251107788375 0.0005070430560917572
0.847002811709291 0.0005190348341418963
0.8479514191847253 0.0005436820468382854
0.8498218343813563 0.0005957056173781013
0.8502839323490993 0.000609295683050785
0.850743854115922 0.0006231247905634578
0.8516572204804961 0.0006515109180193241
0.853458398894626 0.0007112705744783362
0.8538740144300152 0.0007258083171668824
0.8542878193468926 0.0007405732106755942
0.8551100366605946 0.0007707933180875404
0.8567331725542408 0.0008340569538302366
0.8571345750015424 0.0008504740289372028
0.857534243662208 0.0008671360124817237
0.8583284167274731 0.0009012035861597845
0.8598963618348788 0.0009723752747427367
0.8602841504683026 0.000990813733443152
0.8606702778105391 0.0010095148301262071
0.8614375836474831 0.0010477137646421968
0.8629526416440031 0.0011273602168183135
0.8659064260389627 0.0013001371241911281
0.8662686526515834 0.0013230406446369347
0.8666293511272967 0.0013462416406702954
0.8673461949564625 0.001393544578696149
0.8687618861341855 0.0014918134721966171
0.8691121040462103 0.0015171560758894705
0.8694608550144425 0.0015428130001380767
0.8701539857284838 0.0015950780790112845
0.8715229667237582 0.0017034705303133832
0.8718616539022199 0.001731385129212897
0.8721989320651564 0.0017596303428201725
0.872869289388101 0.0018171205716894802
0.8741934017122753 0.0019361553276167284
0.8767767284384262 0.0021908730157051953
0.8770874834825313 0.002223650744631109
0.8773969869067121 0.0022567754964680775
0.8780122626685526 0.0023240728251292713
0.8792280541560329 0.0024629053433908948
0.8816018807627982 0.0027578828797205105
0.881893303585002 0.002796408517797617
0.8821835656615524 0.0028353066144683934
0.8827606290794539 0.0029142260342516816
0.883901061649588 0.0030765978664119226
0.8861283122948463 0.0034197808366238413
0.8864017911977455 0.0034644329563165875
0.8866741916746625 0.0035094790845266914
0.8872157768662097 0.003600758173207383
0.888286219201403 0.0037880963572158206
0.8903772481878314 0.004182139393438838
0.890634042820388 0.004233230563359991
0.8908898338596767 0.004284732922613559
0.8913984229336194 0.0043889748724264014
0.8924037520775011 0.00460243230399202
0.894367977825869 0.005049422465630639
0.8946296404126755 0.005112108615386793
0.8948902028048245 0.00517529336468499
0.8954080477247358 0.005303161786974952
0.8964307614266785 0.005564914720051748
0.8984254057611067 0.006112625808590513
0.8986700708942732 0.006183369255184661
0.8989137152654234 0.006254620725147061
0.8993979605857139 0.006398649162004613
0.9003544080844659 0.006692816528908387
0.9022201529333629 0.007305639131185316
0.902449037856334 0.007384539771060294
0.9026769744565379 0.007463951087191793
0.9031300199266494 0.007624305498470034
0.904024919291604 0.00795113825088416
0.9057708871758516 0.008629252625431513
0.9090946885748368 0.010082567848302334
0.9092818968350236 0.010171296370266156
0.909468389674582 0.01026045742829747
0.9098392409157202 0.010440074434407087
0.910572487625927 0.010804468035184906
0.9120058022329365 0.011553719919577335
0.9121819111458714 0.011649278664635578
0.9123573503431167 0.011745257161689237
0.9127062305533843 0.011938469658587933
0.9133960742678678 0.012329889541214924
0.9147446926963559 0.013132479438538784
0.9149104084345259 0.013234633722100394
0.9150754968743736 0.01333719103496383
0.9154038020449806 0.013543510073739506
0.9160529962092239 0.01396093233421555
0.9173222756619905 0.014814634980766619
0.9197487000539764 0.016595080576164937
0.9199078216497182 0.016719086650811815
0.9200662962069338 0.01684351501056214
0.920381315448707 0.01709363075757815
0.9210037124071946 0.017598842849732645
0.9222185531306712 0.018628735075161162
0.9245331580353815 0.020762608322231358
0.9246729073579825 0.020899100737174024
0.9248120935072788 0.021035947396488817
0.925088785983442 0.021310694330496982
0.9256355189148437 0.021864338445972735
0.9267029057952103 0.022987708570439806
0.9287374562553337 0.02529455153989008
0.9288580986972698 0.025438543447554425
0.9289782681435703 0.02558280398551729
0.9292171959964906 0.025872121778534592
0.9296894626902912 0.026453879922317427
0.9306120740554962 0.02762937090087369
0.9323729698467762 0.030024121013620196
0.9324794213463623 0.030175567424303856
0.9325854593890054 0.030327208824187064
0.932796302018321 0.03063106743802409
0.9332131014405624 0.03124102396670066
0.9340275346816447 0.03246938465043457
0.9355826648641054 0.034955860979698064
0.9356703990526622 0.035101898994931185
0.9357578185052208 0.03524804436287889
0.9359317180933154 0.035540650091267556
0.9362757939646188 0.03612707226813422
0.9369493201423809 0.03730436878386791
0.9382399482683448 0.03967370114681727
0.9406111695142683 0.044447781311943824
0.9406869183717939 0.04460992358860743
0.9407623786398382 0.044772069818133337
0.9409124382284408 0.04509636675172041
0.9412091470702815 0.04574492728591572
0.9417891867272469 0.047041512097491724
0.9428977931198007 0.0496294257982584
0.9449244060035842 0.054761179348981316
0.9449799657715435 0.054909636358041705
0.9450353328361704 0.05505800869503079
0.9451454918249732 0.05535449512219284
0.9453635298592401 0.0559464057395587
0.9457906486091332 0.05712574947694491
0.9466103175717037 0.05946478501438708
0.9481208751997605 0.06405166683118148
0.9506487222466087 0.07261513919353746
0.9528604472226588 0.08115013837996406
0.9545320215486064 0.08834403082998278
0.9560082084967046 0.0952981947307872
0.957188817787148 0.10130912344386453
0.9580991510324804 0.10624099586006401
0.958919828360663 0.11092528953331189
0.9595591931432632 0.11474075575411312
0.9601403606245743 0.11834185628941693
0.960618973763021 0.12140681999162109
0.960998190896792 0.12390140811335712
0.9613488606653192 0.12626193172043604
0.9616290351599471 0.1281860319062331
0.961866700414415 0.12984536459113197
0.9620897050108227 0.13142547299091267
0.9622702009182336 0.13272107263982133
0.9624404228672779 0.13395682134291104
0.9625857390786909 0.1350225821969733
0.9627047012167975 0.13590256717520716
0.9628182389302857 0.13674879595614559
0.9629117138019544 0.13745020195929147
0.9629932125472003 0.13806524271487838
0.9630717961338462 0.13866139315041248
0.963137065220827 0.13915887247966413
0.9632001854501651 0.1396420005904689
0.9632528530448143 0.1400466565738013
0.9632993293628924 0.14040490754884546
0.9633446592983838 0.14075537731656376
0.9633827540554143 0.14105071699424204
0.963419988814567 0.14134010566452201
0.9634529243799075 0.14159667303181622
0.9634807815575828 0.1418141148997867
0.9635082086082201 0.1420285898465467
0.9635314851019025 0.14221091273427003
0.9635523505619081 0.14237458838597214
0.963573026617049 0.1425370008175463
0.963590664875343 0.14267572644277013
0.9635909593398826 0.14267804379037294
0.963591253368138 0.14268035774952706
0.9635918401188927 0.14268497552606682
0.9635930084189657 0.14269417067645157
0.9635953243847419 0.14271240067162122
0.963599875128808 0.1427482297254643
0.9636001560086451 0.1427504415099612
0.9636004364762094 0.1427526500889776
0.9636009961774187 0.1427570576526824
0.9636021106643713 0.14276583455696004
0.9636043201368695 0.14278323669725476
0.9636045945065363 0.14278539785167638
0.963604868475357 0.1427875558878074
0.9636054152132648 0.14279186262661805
0.9636065039097086 0.14280043891978275
0.9636067750921755 0.1428025752773033
0.9636070458793708 0.14280470855909896
0.9636075862707069 0.14280896591659878
0.9636078558762242 0.14281109000281844
0.9636081250892232 0.14281321103434413
0.9636083939103889 0.14281532901640764
0.9636086623404047 0.1428174439542304

···

On 05/25/2018 03:44 AM, Akhilesh Nautiyal wrote:

On Thu, May 24, 2018 at 10:24 PM, vincent.adrien at gmail.com > <mailto:vincent.adrien at gmail.com> <vincent.adrien at gmail.com > <mailto:vincent.adrien at gmail.com>> wrote:
    On 05/24/2018 05:13 AM, Akhilesh Nautiyal wrote:

Dear Adrien,

   Thanks a lot for your kind help. With this I am getting an extra filled
region as the abscissa of N_46 is getting extended. I will try to play
around with this to find some solution.

Regards,
akhilesh

···

On Fri, May 25, 2018 at 6:10 PM, vincent.adrien at gmail.com < vincent.adrien at gmail.com> wrote:

Hi Akhilesh,

Then I guess that you need to somehow interpolate your data to share the
same abscissa values, at least for the ?fill between? step. I am not very
used to do this kind of things but please find attached a script that may
be helpful to you (it produces to attached PNG, with Matplotlib 2.2). It
uses Numpy to perform linear interpolation of your data; scipy.interpolate
may also be a good source of interpolation tools if this is not good enough
for you.

Best,
Adrien

PS : I also reattach the data files, to make it easier to play with the
script if somebody else wanted to propose a better solution.

On 05/25/2018 03:44 AM, Akhilesh Nautiyal wrote:

Dear Adrien,

          Thanks for the reply. I have tried all that. Actually in my
case the two curves have different size of abscissa and ordinates.
Suppose I make arrays like x1, y1 and x2, y2 from two data files
attached in my previous mail, the arrays x1 and x2 have different size
and the arrays y1 and y2 have different size.
I will be grateful if you can help me how to fill the area between these
curves n this particular case.

With Regards,
akhilesh

On Thu, May 24, 2018 at 10:24 PM, vincent.adrien at gmail.com <mailto: >> vincent.adrien at gmail.com> <vincent.adrien at gmail.com <mailto: >> vincent.adrien at gmail.com>> wrote:

    Hi Akhliesh,

    For basic usage of Matpolotlib, the following tutorials may be good
    starting points:
       * https://matplotlib.org/tutorials/introductory/pyplot.html
    <https://matplotlib.org/tutorials/introductory/pyplot.html>
       * https://matplotlib.org/tutorials/introductory/usage.html
    <https://matplotlib.org/tutorials/introductory/usage.html>
    To enforce peculiar x- and y-ranges, I think that you may want to
    use `ax.set_xlim` and `ax.set_ylim` (or `plt.xlim` and `plt.ylim` if
    you prefer the interactive Pyplot interface rather than the
    object-oriented one).

    Besides, you may find the following example useful:
    https://matplotlib.org/gallery/lines_bars_and_markers/fill_
between_demo.html
    <https://matplotlib.org/gallery/lines_bars_and_markers/fill_
between_demo.html>
    to learn how to fill the aerea between 2 curves.

    Hopefully this will help you a bit.

    Best regards,
    Adrien

    On 05/24/2018 05:13 AM, Akhilesh Nautiyal wrote:

        Dear Sir/Madam,

                             I am plotting with matplotlib using two
        data files with different x and y ranges. I need to fill up the
        region between the two curves. I request you to kindly help me
        in this regard. I am attaching the files with
        this e-mail. the plot range should be between x->0.93 to 1.0 and
        y->0 to 0.25.

        Thanking you,
        Sincerely,
        akhliesh

        -- *****************************
******************************************************************
        * Dr. Akhilesh Nautiyal
        * Assistant Professor
        * Department of Physics
        * Malaviya National Institute of Technology Jaipur
        * JLN Marg Jaipur-302017
        * Mo: +91-9 <tel:%2B91-9445520847>549657939
        ************************************************************
***********************************

        This body part will be downloaded on demand.

--
************************************************************
***********************************
* Dr. Akhilesh Nautiyal
* Assistant Professor
* Department of Physics
* Malaviya National Institute of Technology Jaipur
* JLN Marg Jaipur-302017
* Mo: +91-9 <tel:%2B91-9445520847>549657939
************************************************************
***********************************

--
***********************************************************************************************
* Dr. Akhilesh Nautiyal
* Assistant Professor
* Department of Physics
* Malaviya National Institute of Technology Jaipur
* JLN Marg Jaipur-302017
* Mo: +91-9 <%2B91-9445520847>549657939
***********************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180529/e8b503e7/attachment.html>

Akhilesh,

I am not totally sure that I understand what is your remaining issue. To
me, it seems that it is just a matter of building the ?correct? common
abscissa vector to pass to ``fill_between``. See for example the
attached snippet for another kind of abscissa vector that would be
possible and maybe better suited to what you want.

Regards,
Adrien

Dear Adrien,

? ?Thanks a lot for your kind help. With this I am getting an extra
filled region as the abscissa of N_46 is getting extended. I will try to
play around with this to find some solution.

Regards,
akhilesh

    Hi Akhilesh,

    Then I guess that you need to somehow interpolate your data to share
    the same abscissa values, at least for the ?fill between? step. I am
    not very used to do this kind of things but please find attached a
    script that may be helpful to you (it produces to attached PNG, with
    Matplotlib 2.2). It uses Numpy to perform linear interpolation of
    your data; scipy.interpolate may also be a good source of
    interpolation tools if this is not good enough for you.

    Best,
    Adrien

    PS : I also reattach the data files, to make it easier to play with
    the script if somebody else wanted to propose a better solution.

        Dear Adrien,

         ?? ? ? ? ?Thanks for the reply. I have tried all that. Actually
        in my case the two? curves have different size of abscissa and
        ordinates.? Suppose I make arrays like x1, y1 and x2, y2 from
        two data files
        attached in my previous mail, the arrays x1 and x2 have
        different size and the arrays y1 and y2 have different size.
        I will be grateful if you can help me how to fill the area
        between these curves n this particular case.

        With Regards,
        akhilesh

        On Thu, May 24, 2018 at 10:24 PM, vincent.adrien at gmail.com
        <mailto:vincent.adrien at gmail.com>
        <mailto:vincent.adrien at gmail.com
        <mailto:vincent.adrien at gmail.com>> <vincent.adrien at gmail.com
        <mailto:vincent.adrien at gmail.com>
        <mailto:vincent.adrien at gmail.com
        <mailto:vincent.adrien at gmail.com>>> wrote:

         ? ? Hi Akhliesh,

         ? ? For basic usage of Matpolotlib, the following tutorials may
        be good
         ? ? starting points:
         ? ? ?? *
        https://matplotlib.org/tutorials/introductory/pyplot.html
        <https://matplotlib.org/tutorials/introductory/pyplot.html>
         ? ? <https://matplotlib.org/tutorials/introductory/pyplot.html
        <https://matplotlib.org/tutorials/introductory/pyplot.html>>
         ? ? ?? *
        https://matplotlib.org/tutorials/introductory/usage.html
        <https://matplotlib.org/tutorials/introductory/usage.html>
         ? ? <https://matplotlib.org/tutorials/introductory/usage.html
        <https://matplotlib.org/tutorials/introductory/usage.html>>
         ? ? To enforce peculiar x- and y-ranges, I think that you may
        want to
         ? ? use `ax.set_xlim` and `ax.set_ylim` (or `plt.xlim` and
        `plt.ylim` if
         ? ? you prefer the interactive Pyplot interface rather than the
         ? ? object-oriented one).

         ? ? Besides, you may find the following example useful:
        https://matplotlib.org/gallery/lines_bars_and_markers/fill_between_demo.html
        <https://matplotlib.org/gallery/lines_bars_and_markers/fill_between_demo.html>
            
        <https://matplotlib.org/gallery/lines_bars_and_markers/fill_between_demo.html
        <https://matplotlib.org/gallery/lines_bars_and_markers/fill_between_demo.html>>
         ? ? to learn how to fill the aerea between 2 curves.

         ? ? Hopefully this will help you a bit.

         ? ? Best regards,
         ? ? Adrien

         ? ? On 05/24/2018 05:13 AM, Akhilesh Nautiyal wrote:

         ? ? ? ? Dear Sir/Madam,

         ? ? ? ? ??? ? ? ? ? ? ? ? ? ?I am plotting with matplotlib
        using two
         ? ? ? ? data files with different x and y ranges. I need to
        fill up the
         ? ? ? ? region between the two curves. I request you to kindly
        help me
         ? ? ? ? in this regard. I am attaching the files with
         ? ? ? ? this e-mail. the plot range should be between x->0.93
        to 1.0 and
         ? ? ? ? y->0 to 0.25.

         ? ? ? ? Thanking you,
         ? ? ? ? Sincerely,
         ? ? ? ? akhliesh

         ? ? ? ? --
         ?***********************************************************************************************
         ? ? ? ? * ? ?Dr. Akhilesh Nautiyal
         ? ? ? ? *?? Assistant Professor
         ? ? ? ? *?? Department of Physics
         ? ? ? ? * ? Malaviya National Institute of Technology Jaipur
         ? ? ? ? * ? JLN Marg Jaipur-302017
         ? ? ? ? * ?? Mo: +91-9 <tel:%2B91-9445520847>549657939
                
        ***********************************************************************************************

         ? ? ? ? This body part will be downloaded on demand.

        --
        ***********************************************************************************************
        * ? ?Dr. Akhilesh Nautiyal
        *?? Assistant Professor
        *?? Department of Physics
        * ? Malaviya National Institute of Technology Jaipur
        * ? JLN Marg Jaipur-302017
        * ?? Mo: +91-9 <tel:%2B91-9445520847>549657939
        ***********************************************************************************************

--
***********************************************************************************************
* ? ?Dr. Akhilesh Nautiyal
*?? Assistant Professor
*?? Department of Physics
* ? Malaviya National Institute of Technology Jaipur
* ? JLN Marg Jaipur-302017
* ?? Mo: +91-9 <tel:%2B91-9445520847>549657939
***********************************************************************************************

-------------- next part --------------
A non-text attachment was scrubbed...
Name: example_akhilesh_v2.py
Type: text/x-python
Size: 1652 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180529/a39a0473/attachment-0001.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example_akhilesh_v2.png
Type: image/png
Size: 26833 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180529/a39a0473/attachment-0001.png>

···

On 05/28/2018 10:50 PM, Akhilesh Nautiyal wrote:

On Fri, May 25, 2018 at 6:10 PM, vincent.adrien at gmail.com > <mailto:vincent.adrien at gmail.com> <vincent.adrien at gmail.com > <mailto:vincent.adrien at gmail.com>> wrote:
    On 05/25/2018 03:44 AM, Akhilesh Nautiyal wrote:

Dear Adrien,
Thanks again for your kindly help. My problem is solved. I could get the
plot I needed, which is attached here. I had to plot one more data file and
had to use two fill_between calls.

Regards,
akhilesh

···

On Wed, May 30, 2018 at 7:23 AM, vincent.adrien at gmail.com < vincent.adrien at gmail.com> wrote:

Akhilesh,

I am not totally sure that I understand what is your remaining issue. To
me, it seems that it is just a matter of building the ?correct? common
abscissa vector to pass to ``fill_between``. See for example the attached
snippet for another kind of abscissa vector that would be possible and
maybe better suited to what you want.

Regards,
Adrien

On 05/28/2018 10:50 PM, Akhilesh Nautiyal wrote:

Dear Adrien,

    Thanks a lot for your kind help. With this I am getting an extra
filled region as the abscissa of N_46 is getting extended. I will try to
play around with this to find some solution.

Regards,
akhilesh

On Fri, May 25, 2018 at 6:10 PM, vincent.adrien at gmail.com <mailto: >> vincent.adrien at gmail.com> <vincent.adrien at gmail.com <mailto: >> vincent.adrien at gmail.com>> wrote:

    Hi Akhilesh,

    Then I guess that you need to somehow interpolate your data to share
    the same abscissa values, at least for the ?fill between? step. I am
    not very used to do this kind of things but please find attached a
    script that may be helpful to you (it produces to attached PNG, with
    Matplotlib 2.2). It uses Numpy to perform linear interpolation of
    your data; scipy.interpolate may also be a good source of
    interpolation tools if this is not good enough for you.

    Best,
    Adrien

    PS : I also reattach the data files, to make it easier to play with
    the script if somebody else wanted to propose a better solution.

    On 05/25/2018 03:44 AM, Akhilesh Nautiyal wrote:

        Dear Adrien,

                   Thanks for the reply. I have tried all that. Actually
        in my case the two curves have different size of abscissa and
        ordinates. Suppose I make arrays like x1, y1 and x2, y2 from
        two data files
        attached in my previous mail, the arrays x1 and x2 have
        different size and the arrays y1 and y2 have different size.
        I will be grateful if you can help me how to fill the area
        between these curves n this particular case.

        With Regards,
        akhilesh

        On Thu, May 24, 2018 at 10:24 PM, vincent.adrien at gmail.com
        <mailto:vincent.adrien at gmail.com>
        <mailto:vincent.adrien at gmail.com
        <mailto:vincent.adrien at gmail.com>> <vincent.adrien at gmail.com
        <mailto:vincent.adrien at gmail.com>
        <mailto:vincent.adrien at gmail.com

        <mailto:vincent.adrien at gmail.com>>> wrote:

             Hi Akhliesh,

             For basic usage of Matpolotlib, the following tutorials may
        be good
             starting points:
                *
        https://matplotlib.org/tutorials/introductory/pyplot.html
        <https://matplotlib.org/tutorials/introductory/pyplot.html>
             <https://matplotlib.org/tutorials/introductory/pyplot.html
        <https://matplotlib.org/tutorials/introductory/pyplot.html>>
                *
        https://matplotlib.org/tutorials/introductory/usage.html
        <https://matplotlib.org/tutorials/introductory/usage.html>
             <https://matplotlib.org/tutorials/introductory/usage.html
        <https://matplotlib.org/tutorials/introductory/usage.html>>
             To enforce peculiar x- and y-ranges, I think that you may
        want to
             use `ax.set_xlim` and `ax.set_ylim` (or `plt.xlim` and
        `plt.ylim` if
             you prefer the interactive Pyplot interface rather than the
             object-oriented one).

             Besides, you may find the following example useful:
        https://matplotlib.org/gallery/lines_bars_and_markers/fill_
between_demo.html
        <https://matplotlib.org/gallery/lines_bars_and_markers/fill_
between_demo.html>
                    <https://matplotlib.org/galler
y/lines_bars_and_markers/fill_between_demo.html
        <https://matplotlib.org/gallery/lines_bars_and_markers/fill_
between_demo.html>>
             to learn how to fill the aerea between 2 curves.

             Hopefully this will help you a bit.

             Best regards,
             Adrien

             On 05/24/2018 05:13 AM, Akhilesh Nautiyal wrote:

                 Dear Sir/Madam,

                                      I am plotting with matplotlib
        using two
                 data files with different x and y ranges. I need to
        fill up the
                 region between the two curves. I request you to kindly
        help me
                 in this regard. I am attaching the files with
                 this e-mail. the plot range should be between x->0.93
        to 1.0 and
                 y->0 to 0.25.

                 Thanking you,
                 Sincerely,
                 akhliesh

                 -- *****************************
******************************************************************
                 * Dr. Akhilesh Nautiyal
                 * Assistant Professor
                 * Department of Physics
                 * Malaviya National Institute of Technology Jaipur
                 * JLN Marg Jaipur-302017
                 * Mo: +91-9 <tel:%2B91-9445520847>549657939
                        ******************************
*****************************************************************

                 This body part will be downloaded on demand.

        -- *****************************
******************************************************************
        * Dr. Akhilesh Nautiyal
        * Assistant Professor
        * Department of Physics
        * Malaviya National Institute of Technology Jaipur
        * JLN Marg Jaipur-302017
        * Mo: +91-9 <tel:%2B91-9445520847>549657939
        ************************************************************
***********************************

--
************************************************************
***********************************
* Dr. Akhilesh Nautiyal
* Assistant Professor
* Department of Physics
* Malaviya National Institute of Technology Jaipur
* JLN Marg Jaipur-302017
* Mo: +91-9 <tel:%2B91-9445520847>549657939
************************************************************
***********************************

--
***********************************************************************************************
* Dr. Akhilesh Nautiyal
* Assistant Professor
* Department of Physics
* Malaviya National Institute of Technology Jaipur
* JLN Marg Jaipur-302017
* Mo: +91-9 <%2B91-9445520847>549657939
***********************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180531/8055f263/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: filled_region.png
Type: image/png
Size: 24789 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180531/8055f263/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: filling.py
Type: text/x-python
Size: 1435 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180531/8055f263/attachment-0001.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ns_r_N_46.dat
Type: application/octet-stream
Size: 8770 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180531/8055f263/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ns_r_N_46_55.dat
Type: application/octet-stream
Size: 7 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180531/8055f263/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ns_r_N_55.dat
Type: application/octet-stream
Size: 10149 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180531/8055f263/attachment-0005.obj>