9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Using plot(1)
@ 2016-11-27  3:03 Chris McGee
  2016-11-27  8:35 ` Steve Simon
  0 siblings, 1 reply; 3+ messages in thread
From: Chris McGee @ 2016-11-27  3:03 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hi All,

I’m trying graph and plot out. I have some questions.

Is there a way to pipe the output of plot or do I need to pull that out of the screen/window buffer? Also, is there a way to plot on top of an existing image?

I tried making a simple plot routine to draw a red unit circle with x and y axes. The lines are drawing fine, but the circle is completely cut off except for a hint of the top-most and bottom-most edges. Here’s the routine that I’m using. Is there something obvious that I’m doing wrong?

o
ra -1.0 -1.0 1.0 1.0
e
co r
cf r
di 0.0 0.0 1.0
co k
li 0.0 -1.0 0.0 1.0
li -1.0 0.0 1.0 0.0
cl

Thanks,
Chris


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] Using plot(1)
  2016-11-27  3:03 [9fans] Using plot(1) Chris McGee
@ 2016-11-27  8:35 ` Steve Simon
  2016-11-27 22:12   ` Chris McGee
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Simon @ 2016-11-27  8:35 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

hi,

not sure what you mean by pipe the output, if you want to save the graph
you need to do that by grabbing the window, there could be things like gifplot which render the plot command stream into a gif, but it doesn't (yet).

i am pretty sure graph has a "don't clear the screen" option if that will do for you,
however my suspicion is that if you close and reopen the stream to plot it will
clear and redraw the screen. i thing (guess) that you would need to send all your
plot commands in a single stream.

steve

> On 27 Nov 2016, at 03:03, Chris McGee <newton688@gmail.com> wrote:
> 
> Hi All,
> 
> I’m trying graph and plot out. I have some questions.
> 
> Is there a way to pipe the output of plot or do I need to pull that out of the screen/window buffer? Also, is there a way to plot on top of an existing image?
> 
> I tried making a simple plot routine to draw a red unit circle with x and y axes. The lines are drawing fine, but the circle is completely cut off except for a hint of the top-most and bottom-most edges. Here’s the routine that I’m using. Is there something obvious that I’m doing wrong?
> 
> o
> ra -1.0 -1.0 1.0 1.0
> e
> co r
> cf r
> di 0.0 0.0 1.0
> co k
> li 0.0 -1.0 0.0 1.0
> li -1.0 0.0 1.0 0.0
> cl
> 
> Thanks,
> Chris




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] Using plot(1)
  2016-11-27  8:35 ` Steve Simon
@ 2016-11-27 22:12   ` Chris McGee
  0 siblings, 0 replies; 3+ messages in thread
From: Chris McGee @ 2016-11-27 22:12 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Thanks,

> not sure what you mean by pipe the output, if you want to save the graph
> you need to do that by grabbing the window, there could be things like gifplot which render the plot command stream into a gif, but it doesn't (yet).

Yes, this is what I was after. I'll try fetching the window buffer and extract it from there. I'll see if a command line switch can be added easily to plot to do just that.

> i am pretty sure graph has a "don't clear the screen" option if that will do for you,
> however my suspicion is that if you close and reopen the stream to plot it will
> clear and redraw the screen. i thing (guess) that you would need to send all your
> plot commands in a single stream.

I was thinking that if plot didn't automatically clear the window (maybe with an option) you could add a background to the plot. Another option could be for plot to have an image command that imports and draws one from a file.

>> o
>> ra -1.0 -1.0 1.0 1.0
>> e
>> co r
>> cf r
>> di 0.0 0.0 1.0
>> co k
>> li 0.0 -1.0 0.0 1.0
>> li -1.0 0.0 1.0 0.0
>> cl


I tried this same plot program on a raspberry Pi with much slower graphics and I noticed that the red circle is drawn for an instant and then disappears behind a white box that covers most of it. I tried it without the lines and it's the same thing. Not sure what is clipping the circle. Very strange.

Chris


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-27 22:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-27  3:03 [9fans] Using plot(1) Chris McGee
2016-11-27  8:35 ` Steve Simon
2016-11-27 22:12   ` Chris McGee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).