Code Monkey home page Code Monkey logo

Comments (7)

parente avatar parente commented on May 22, 2024 5

Does the magic %matplotlib inline fix it in the notebook?

from docker-stacks.

juls858 avatar juls858 commented on May 22, 2024

thanks! that fixed it!

On Sat, Oct 31, 2015 at 6:34 PM, Peter Parente [email protected]
wrote:

Does the magic %matplotlib inline fix it in the notebook?


Reply to this email directly or view it on GitHub
#58 (comment)
.

from docker-stacks.

dhuanca avatar dhuanca commented on May 22, 2024

really works! thank you! -.-'

from docker-stacks.

francica avatar francica commented on May 22, 2024

where should I run %matplotlib inline?
In bash? or in the py file?

thanks

from docker-stacks.

parente avatar parente commented on May 22, 2024

The latest images should automatically default to the inline matplotlib backend. docker pull to get the latest if you haven't recently.

from docker-stacks.

lohetvr avatar lohetvr commented on May 22, 2024

I face the same problem too despite using
%matplotlib inline #plots it on the notebook itself

The error message for the code is as follows:

RuntimeError Traceback (most recent call last)
in ()
----> 1 print plt.plot(test_data['sqft_living'],test_data['price'],'.',test_data['sqft_living'],sqft_model.predict(test_data),'-')

/opt/conda/lib/python2.7/site-packages/matplotlib/pyplot.pyc in plot(_args, *_kwargs)
3145 @_autogen_docstring(Axes.plot)
3146 def plot(_args, *_kwargs):
-> 3147 ax = gca()
3148 # allow callers to override the hold state by passing hold=True|False
3149 washold = ax.ishold()

/opt/conda/lib/python2.7/site-packages/matplotlib/pyplot.pyc in gca(**kwargs)
926 matplotlib.figure.Figure.gca : The figure's gca method.
927 """
--> 928 return gcf().gca(**kwargs)
929
930 # More ways of creating axes:

/opt/conda/lib/python2.7/site-packages/matplotlib/pyplot.pyc in gcf()
576 return figManager.canvas.figure
577 else:
--> 578 return figure()
579
580

/opt/conda/lib/python2.7/site-packages/matplotlib/pyplot.pyc in figure(num, figsize, dpi, facecolor, edgecolor, frameon, FigureClass, *_kwargs)
525 frameon=frameon,
526 FigureClass=FigureClass,
--> 527 *_kwargs)
528
529 if figLabel:

/opt/conda/lib/python2.7/site-packages/matplotlib/backends/backend_qt4agg.pyc in new_figure_manager(num, _args, *_kwargs)
44 FigureClass = kwargs.pop('FigureClass', Figure)
45 thisFig = FigureClass(_args, *_kwargs)
---> 46 return new_figure_manager_given_figure(num, thisFig)
47
48

/opt/conda/lib/python2.7/site-packages/matplotlib/backends/backend_qt4agg.pyc in new_figure_manager_given_figure(num, figure)
51 Create a new figure manager instance for the given figure.
52 """
---> 53 canvas = FigureCanvasQTAgg(figure)
54 return FigureManagerQT(canvas, num)
55

/opt/conda/lib/python2.7/site-packages/matplotlib/backends/backend_qt4agg.pyc in init(self, figure)
74 if DEBUG:
75 print('FigureCanvasQtAgg: ', figure)
---> 76 FigureCanvasQT.init(self, figure)
77 FigureCanvasQTAggBase.init(self, figure)
78 FigureCanvasAgg.init(self, figure)

/opt/conda/lib/python2.7/site-packages/matplotlib/backends/backend_qt4.pyc in init(self, figure)
66 if DEBUG:
67 print('FigureCanvasQt qt4: ', figure)
---> 68 _create_qApp()
69
70 # Note different super-calling style to backend_qt5

/opt/conda/lib/python2.7/site-packages/matplotlib/backends/backend_qt5.pyc in _create_qApp()
136 display = os.environ.get('DISPLAY')
137 if display is None or not re.search(':\d', display):
--> 138 raise RuntimeError('Invalid DISPLAY variable')
139
140 qApp = QtWidgets.QApplication([str(" ")])

RuntimeError: Invalid DISPLAY variable

I am new to programming and I am learning as much as I can through the internet, any help would be much appreciated as this is hindering my progress!

from docker-stacks.

kampandi avatar kampandi commented on May 22, 2024

Thanks, it works fine

from docker-stacks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.