Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

size attribute ignored #30

Open
ufechner7 opened this issue Jun 5, 2022 · 3 comments
Open

size attribute ignored #30

ufechner7 opened this issue Jun 5, 2022 · 3 comments

Comments

@ufechner7
Copy link

ufechner7 commented Jun 5, 2022

I am not able to change the size of the plot window. Example code:

using Plots; inspectdr()

x=0:0.05:100
y1=sin.(x)

p1 = plot(x,y1, size=(1200,700), legend=false)
display(p1);

The size is always small, about 640x480. How can I increase the initial size of the plot window?

@ufechner7
Copy link
Author

ufechner7 commented Jun 5, 2022

I also tried, as explained in the README, but it doesn't work:

DEFAULTS_INSPECTDR = Dict(
	:rendersvg => true,

	#Special options available @ initialization:
	:droppoints => :always, #One of: {:always, :never, :noglyph, :hasline}
	:notation_x => :SI,   #Change x-axis notation
	:notation_y => :SI,   #Change y-axis notation
	:fontname => "Sans",  #Change default font family
	:fontscale => 1.2,    #Scale up/down font default sizes

	#Basic plot options:
    :halloc_data => 1000,
    :valloc_data =>  700,
)
using Plots; inspectdr()

@ufechner7
Copy link
Author

ufechner7 commented Jun 5, 2022

Solution from discourse:

using Plots; inspectdr()

x=0:0.05:100
y1=sin.(x)

p1 = plot(x,y1, legend=false)
pIDR=display(p1); #Display with InspectDR and keep plot object
resize!(pIDR.wnd, 1200, 700) #Resize GTK window directly

Well, this is more like a work-around. Other plotting backends of Plots.jl use the size attribute also for as window size, so I think for consistency it would be good if InspectDR would behave in the same way.

@ma-laforge
Copy link
Owner

That does sound like a very good argument - even if I wasn't initially looking at it that way.

I admit, I'm not 100% certain on how to do this... because the size() attribute in Plots.jl code appears to control subplot size (not the final plot size).

I don't see myself looking into this in the near future, but feel free to take a look that the code in Plots.jl:
-->https://github.com/JuliaPlots/Plots.jl
src/backends/inspectdr.jl

I typically use one of the more complete/actively developed backends as an example (like GR):
src/backends/gr.jl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants