scitools icon indicating copy to clipboard operation
scitools copied to clipboard

plot does not show inline

Open RobertMZ opened this issue 9 years ago • 6 comments

If one uses the plot function of scitools, it does not show the plot (even with the raw_input(' ')), but it can save the figure as a pdf.

RobertMZ avatar Apr 21 '16 10:04 RobertMZ

Which backend are you using?

johannesring avatar Apr 21 '16 10:04 johannesring

backend is the matplotlib; if I import plot from matplotlib everything works fine.

RobertMZ avatar Apr 21 '16 12:04 RobertMZ

I have exactly the same problem. I am (very) puzzled.

I installed scitools from https://github.com/hplgit/scitools and it loads fine. I ran the diagnostics and all fine. I can run matplotlib - all fine.

I cannot see the plot. I can save it as eps or pdf - fine.

Help?

jacobsca avatar Aug 09 '18 02:08 jacobsca

You can fix this by calling the show function on the matplotlib backend object, like in this example:

from scitools.std import *
x = linspace(0, 2*pi, 101)
y = sin(x)
plot(x, y)
show()
g = get_backend()
g.show()
raw_input('press enter')

johannesring avatar Aug 09 '18 07:08 johannesring

Works! Thanks. Clas A. Jacobson

[email protected]

  From: Johannes Ring <[email protected]>

To: hplgit/scitools [email protected] Cc: jacobsca [email protected]; Comment [email protected] Sent: Thursday, August 9, 2018 3:09 AM Subject: Re: [hplgit/scitools] plot does not show inline (#40)

You can fix this by calling the show function on the matplotlib backend object, like in this example:from scitools.std import * x = np.linspace(0, 2*pi, 101) y = np.sin(x) plot(x, y) show() g = get_backend() g.show() raw_input('press enter')— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

jacobsca avatar Aug 09 '18 08:08 jacobsca

Johannes Sorry for what may seem like a (very) dumb question. My dolfin under 2.7 has disappeared. I have a dolfin under python3 but the entire fenics under 2.7 has gone. I'm not at all sure why. How can I get it back? I use python 2.7 almost exclusively...I'm not sure what happened? Clas  Clas A. Jacobson1010 Horizon WayCT 06084 860 783 0074 (home) [email protected]

  From: Johannes Ring <[email protected]>

To: hplgit/scitools [email protected] Cc: jacobsca [email protected]; Comment [email protected] Sent: Thursday, August 9, 2018 3:09 AM Subject: Re: [hplgit/scitools] plot does not show inline (#40)

You can fix this by calling the show function on the matplotlib backend object, like in this example:from scitools.std import * x = np.linspace(0, 2*pi, 101) y = np.sin(x) plot(x, y) show() g = get_backend() g.show() raw_input('press enter')— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

jacobsca avatar Aug 28 '18 00:08 jacobsca