2

How do I control the position of a chart on the Excel sheet using Datanitro? I thought that by setting the active cell it would be positioned there but it always comes out as top left where it obscures cells with calculated results that I want to remain visible.

mcgerard
  • 33
  • 4

1 Answers1

1

You can pass x and y to Image to position a chart: https://datanitro.com/docs/images.html#x

With nitroplot, you can pass x and y to the graph library:

nitroplot.graph(x = 123, y = 456)
Ben Lerner
  • 1,318
  • 9
  • 12
  • Thanks Ben but I cannot get that to work with a chart. I have: fig = nitroplot.figure(figsize = (5, 2)) ax1 = fig.add_subplot(111, title = "Something") fig.x = 200 fig.y = 500 That doesn't work. I also tried ax1.x and having the statements before and after the nitroplot.graph() statement. – mcgerard Jul 04 '15 at 10:04
  • Sorry - didn't format my code correctly. Hope it is clear. – mcgerard Jul 04 '15 at 10:21
  • Updated my answer: you should pass x and y to nitroplot (which passes it on to Excel), rather than modify the figure. – Ben Lerner Jul 04 '15 at 17:06
  • Thanks Ben. That works fine. I suggest to add the information to the Datanitro documentation. I found out that if you move the chart manually after first creation, it retains that place when the script is run again to update the chart so that is also a "sort of" solution. – mcgerard Jul 04 '15 at 18:16