سؤال

أريد استخدام Grid.Table () في مؤامرة موجودة في R. ومع ذلك، لا يمكنني تحديد موقع هذا الجدول على الجانب الأيمن من المخطط الخاص بي.لذلك الشيء هو:

أولا وقبل كل شيء، أقوم بإجراء رسم بياني لبياناتي: giveacodicetagpre.

بعد ذلك، قمت بتنفيذ وظيفة تتأثر في مخطط موجود منحنى Weibull يعطي كلا المعلمين A و K: giveacodicetagpre.

وأخيرا أريد وضع بيانات. الإطار باستخدام الشبكة. لأنه يعرض الخلايا في شكل جميل للغاية، ويمكنك استخدام النص المائل والجري في الخلايا. giveacodicetagpre.

المشكلة هي أن هذا الجدول يظهر في مركز الجهاز أمام الرسم البياني والمنحنى، وأريد أن يكون في الجانب الأيمن.

بعد كل شيء، أود أن أعرف أداة النقر على الرسم البياني، وأود أن أتلقى المنطقة تحت منحنى WeiBull الخاص بي.

هل كانت مفيدة؟

المحلول

The hist function is base graphics and the grid.table function is grid graphics. The 2 graphics systems do not play nicely together without extra effort (as you have noticed).

The easiest fix is to use the addtable2plot function from the plotrix package rather than grid.table. It may not look the same but it would be simple.

Another option is to use a grid graphics function to create the histogram, such as something from the lattice or ggplot2 packages (both can do histograms), then create a specific viewport using grid graphics functions and use grid.table to put the table into that viewport.

Last, if you really want to mix them then see the gridBase package for ways to mix grid and base graphics.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top