<div dir="ltr"><div>Dear yt-users,</div><div><br></div><div>Hi, I want to ask <span style="font-size:14px">you about phase plot. Some days ago, I asked how to sum up different datasets to make one profile plot, and it worked fine. This time, I tried to do the same thing in phase plot, but it did not work fine. Could you help me find out what the problem is?</span></div><div><br></div><div>(inside for loop):</div><div><div>     profile_medium = yt.create_profile(</div><div>             data_source=medium_region,</div><div>             bin_fields=["density", "temperature"],</div><div>             fields=["cell_mass"],</div><div>             n_bins=[128, 128],</div><div>             units=dict(),</div><div>             logs=dict(),</div><div>             weight_field=None,</div><div>             extrema=dict(density=(1e-30, 1e-20), temperature=(1e1, 1e8))</div><div>          )</div><div>     plot_med = yt.ProfilePlot.from_profiles(profile_medium)</div></div><div>     profile_med = plot_med.profiles[0]<br></div><div>     profiles_sum_med = profiles_sum_med + profile_med["cell_mass"]</div><div>    <br></div><div><br></div><div>my_data_med = {"density": profile_med.x,   <br></div><div>           "temperature": profile_med.y, </div><div>              "cell_mass": profiles_sum_med}</div><div>fake_ds_med = {"current_time": yt.YTQuantity(10, "Myr")} <br></div><div>yt.save_as_dataset(fake_ds_<wbr>med, "phaseplots_med_all.h5", my_data_med)<br></div><div><br></div><div class="gmail_extra">ds = yt.load("phaseplots_med_all.<wbr>h5")</div><div class="gmail_extra">ad = ds.data<br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">profile = yt.create_profile(ad,</div><div class="gmail_extra">                            ["density", "temperature"],</div><div class="gmail_extra">                            n_bins=[128, 128],</div><div class="gmail_extra">                            fields=["cell_mass"], </div><div class="gmail_extra">                            weight_field=None, </div><div class="gmail_extra">                            extrema=dict(density=(1e-30, 1e-20), temperature=(1e1, 1e8))</div><div class="gmail_extra">                           )</div><div class="gmail_extra"><br></div><div class="gmail_extra">and I got this error:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><pre style="box-sizing:border-box;overflow:auto;font-size:14px;padding:0px;margin-top:0px;margin-bottom:0px;line-height:inherit;word-break:break-all;word-wrap:break-word;color:rgb(0,0,0);background-color:transparent;border:0px;border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;white-space:pre-wrap;vertical-align:baseline">could not broadcast input array from shape (128,128) into shape (128)
</pre><div><br></div></div></div><div class="gmail_extra">Sincerely,</div><div class="gmail_extra">Y.T.</div><div class="gmail_extra"><br><div class="gmail_quote">2017-10-26 16:15 GMT-04:00 tyuta <span dir="ltr"><<a href="mailto:y0u1t1a5.t@gmail.com" target="_blank">y0u1t1a5.t@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Suoqing Ji,<div><br></div><div>Thanks! I'll try that.</div></div><div class="gmail-m_1518026569579770407gmail-HOEnZb"><div class="gmail-m_1518026569579770407gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-10-26 15:59 GMT-04:00 Suoqing Ji <span dir="ltr"><<a href="mailto:suoqing@physics.ucsb.edu" target="_blank">suoqing@physics.ucsb.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">



<div>
<div name="messageBodySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">Hi t yuta,
<div><br></div>
<div>What you can do is to get the data as numpy array directly from the profiles you’ve generated, and sum them up by yourself. You can follow the last example at: <a href="http://yt-project.org/docs/dev/visualizing/plots.html#d-profile-plots" target="_blank">http://yt-project.org/docs<wbr>/dev/visualizing/plots.html#d-<wbr>profile-plots</a></div>
<div><br></div>
<div>For each dataset, you can have one profile:</div>
<div>profile = plot.profiles[0]</div>
<div><br></div>
<div>Then you can sum up profile[‘cell_mass'] over different datasets, and plot it against profile.x</div>
</div>
<div name="messageSignatureSection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif"><br>
Best wishes,
<div>—</div>
<div>Suoqing Ji</div>
<div>Ph.D Candidate</div>
<div>Department of Physics</div>
<div>University of California, Santa Barbara</div>
<div><a href="http://physics.ucsb.edu/~suoqing" target="_blank">http://physics.ucsb.edu/~suoqi<wbr>ng</a></div>
</div>
<div name="messageReplySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif"><div><div class="gmail-m_1518026569579770407gmail-m_5603446816555027922h5"><br>
On Oct 26, 2017, 12:51 PM -0700, tyuta <<a href="mailto:y0u1t1a5.t@gmail.com" target="_blank">y0u1t1a5.t@gmail.com</a>>, wrote:<br>
</div></div><blockquote type="cite" style="margin:5px;padding-left:10px;border-left-width:thin;border-left-style:solid;border-left-color:rgb(26,188,156)"><div><div class="gmail-m_1518026569579770407gmail-m_5603446816555027922h5">
<div dir="ltr">Dear yt-users,<br>
<div><br></div>
<div>Hi, I want to ask you about profile plot. I'm analyzing Enzo data, and I'm trying to plot metallicity-cellmass of different 12 datasets into one curve. I can plot 12 curves on one image, but that's not what I want. Does anyone know some good way, or links to documentation?</div>
<div>I've attached the 12-curve plot. I want to sum up all the curves to get one curve.</div>
<div><br></div>
<div>Thanks,</div>
<div>Y.T.<img src="cid:02C67ABD76E846418AE113C0B10469D2" alt="埋め込み画像 2" width="426" height="341"></div>
</div></div></div>
______________________________<wbr>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/lis<wbr>tinfo.cgi/yt-users-spacepope.o<wbr>rg</a><br></blockquote>
</div>
</div>

<br>______________________________<wbr>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/lis<wbr>tinfo.cgi/yt-users-spacepope.o<wbr>rg</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>