# Plotting field versus space

**URL:** <https://root-forum.cern.ch/t/plotting-field-versus-space/53700>\
**Category:** Garfield++\
**Created:** [February 20, 2023, 3:00pm UTC](https://root-forum.cern.ch/t/plotting-field-versus-space/53700 "2023-02-20T15:00:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zhixuan\_He](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/zhixuan_he/32/23812_2.png) [@Zhixuan\_He](https://root-forum.cern.ch/u/Zhixuan_He)\
**Post date:** [February 20, 2023, 3:00pm UTC](https://root-forum.cern.ch/t/plotting-field-versus-space/53700/1 "2023-02-20T15:00:27Z")

</div>

I want to simulate a drift chamber cell  
[Cell.pdf](https://root-forum.cern.ch/uploads/short-url/ji6zmYZAyd37fAVXEWlzAJRU7bj.pdf) (58.9 KB).  
When I plot the field, the result is not the same as others’ work.  
[FieldPlot.pdf](https://root-forum.cern.ch/uploads/short-url/wbsSDcyvdh42v6U9xnD2X86ZbR7.pdf) (20.0 KB)

My code:

```auto
  ViewField fieldplot; 
  fieldplot.SetSensor(&sensor);
  fieldplot.PlotProfile(-0.5, 0., 0., 0.5, 0., 0., "field", true);

```

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [February 21, 2023, 7:09am UTC](https://root-forum.cern.ch/t/plotting-field-versus-space/53700/2 "2023-02-21T07:09:53Z")

</div>

Can you show the other plot that you are comparing with?

---

<div class="post-metadata">

**Author:** ![Zhixuan\_He](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/zhixuan_he/32/23812_2.png) [@Zhixuan\_He](https://root-forum.cern.ch/u/Zhixuan_He)\
**Post date:** [February 21, 2023, 7:31am UTC](https://root-forum.cern.ch/t/plotting-field-versus-space/53700/5 "2023-02-21T07:31:58Z")

</div>

Such as this bro’s plot: [Plotting the electric field profile - Garfield++ - ROOT Forum (cern.ch)](https://root-forum.cern.ch/t/plotting-the-electric-field-profile/41154)

---

<div class="post-metadata">

**Author:** ![Zhixuan\_He](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/zhixuan_he/32/23812_2.png) [@Zhixuan\_He](https://root-forum.cern.ch/u/Zhixuan_He)\
**Post date:** [February 21, 2023, 9:33am UTC](https://root-forum.cern.ch/t/plotting-field-versus-space/53700/6 "2023-02-21T09:33:52Z")

</div>

I know, maybe my result is proper.

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [February 21, 2023, 10:41am UTC](https://root-forum.cern.ch/t/plotting-field-versus-space/53700/7 "2023-02-21T10:41:10Z")

</div>

I think so. I don’t see anything obviously wrong with your plot…

---

<div class="post-metadata">

**Author:** ![Zhixuan\_He](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/zhixuan_he/32/23812_2.png) [@Zhixuan\_He](https://root-forum.cern.ch/u/Zhixuan_He)\
**Post date:** [February 21, 2023, 12:11pm UTC](https://root-forum.cern.ch/t/plotting-field-versus-space/53700/8 "2023-02-21T12:11:15Z")

</div>

Thank you. My misunderstanding.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [March 7, 2023, 12:11pm UTC](https://root-forum.cern.ch/t/plotting-field-versus-space/53700/9 "2023-03-07T12:11:49Z")

</div>

Closed on March 7, 2023, 12:11pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
