Skip to content

Instantly share code, notes, and snippets.

@minrk
Created August 9, 2012 04:37
Show Gist options
  • Select an option

  • Save minrk/3301035 to your computer and use it in GitHub Desktop.

Select an option

Save minrk/3301035 to your computer and use it in GitHub Desktop.
2x plots for Retina displays with matplotlib and the IPython Notebook
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fordhurley

Copy link
Copy Markdown

For anyone stumbling across this, as of PR #3381, you can now enable 2x images by just adding the line:

%config InlineBackend.figure_format = 'retina'

to your notebook.

Thanks!

@mmontag

mmontag commented Aug 29, 2016

Copy link
Copy Markdown

@fordhurley Wow, thanks :)

@ijoseph

ijoseph commented Oct 13, 2017

Copy link
Copy Markdown

Is there a way to add this to a global config file somewhere?

@skaldo

skaldo commented Nov 19, 2017

Copy link
Copy Markdown

@fordhurley awesome, thank you!

@mitchallain

Copy link
Copy Markdown

@ijoseph, add the following line to your ipython_kernel_config.py, which for me is in ~/.ipython/profile_default/

c.InlineBackend.figure_format = 'retina'

If the file does not already exist, you can generate it with all settings commented out by entering ipython profile create at the command line.

@geyang

geyang commented Jun 10, 2018

Copy link
Copy Markdown

6 years later, this thread is still going strong ๐Ÿ˜„

@rxa254

rxa254 commented Sep 10, 2019

Copy link
Copy Markdown

+1

@BKJackson

Copy link
Copy Markdown

Great gist.

@bhattg

bhattg commented Apr 17, 2020

Copy link
Copy Markdown

+1

@gr8den

gr8den commented Sep 18, 2020

Copy link
Copy Markdown

@micaleel

Copy link
Copy Markdown

Still useful in 2020! ๐ŸŽ‰

@pifparfait

Copy link
Copy Markdown

Hi,
Would anyone know how to disable this after activating it? I don't want to delete it. I want to use it for one case and stop using it for another. I'm on jupyter notebook. c.InlineBackend.figure_format = 'retina'

Many thanks
Parfait

@dirroo

dirroo commented Feb 12, 2024

Copy link
Copy Markdown

import matplotlib.pyplot as plt
import numpy as np
import math
fig = plt.figure()
x = np.arange(0,0.3,0.0000001)
s=all(-0.5/x)
k=all(-0.125/x)
j= np.(1+math.exp(s))
m=np.(1+math.exp(k))
n=0.125np.log(j/m)
f=0.032
np.log(j/m)
r=f/n
fig, ax = plt.subplots()
ax.plot(x,r, 'g')
ax.set_xlabel(' Temprature difference')
ax.set_ylabel('Objective function')
ax.set_title('Escaled power vs Temprature difference' )
ax.legend()

@dirroo

dirroo commented Feb 12, 2024

Copy link
Copy Markdown

please help with this code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment