In [ ]:
using InspectDR
#Reset list of displays for demo purposes (in case GtkDisplay is currently active)
function resetdisplays()
dfltdisp = Base.Multimedia.displays[end]
if typeof(dfltdisp) <: InspectDR.GtkDisplay
pop!(Base.Multimedia.displays)
end
nothing
end
include("BodePlots.jl") #Defines BodePlots.* utilities.
plot = BodePlots.new()
fmin = 1e6; fmax = 10e9; G0 = 20
fzero = Inf; fpole1 = 50e6; fpole2 = 10e9
BodePlots.update(plot, fmin, fmax, G0, fzero, fpole1, fpole2) #Generate some data
println("\"plot\" defined.")
nothing
In [ ]:
#Jupyter typically requests inline graphics as SVG first.
#Allowing MIME"image/svg+xml" renderings therefore produces SVG outputs:
InspectDR.defaults.rendersvg = true
resetdisplays() #Just in case
plot #Implicit call to "optimal" "show(..,::MIME,...)" function
In [ ]:
#When MIME"image/svg+xml" is disabled, Jupyter eventually requests PNG inline graphics:
InspectDR.defaults.rendersvg = false
resetdisplays() #Just in case
display(plot) #Explicit call to display plot
nothing
In [ ]:
resetdisplays() #Just in case
pushdisplay(InspectDR.GtkDisplay()) #Make "GtkDisplay" highest priority
display(plot) #This time InspectDR.GtkDisplay() is on top of display stack
nothing
In [ ]:
resetdisplays()
display(Base.Multimedia.displays) #GtkDisplay should not longer be on display stack
display(InspectDR.GtkDisplay(), plot) #Explicit call to use Gtk "display"
nothing
In [ ]:
InspectDR.write_svg("plotsave.svg", plot) #High-quality output!