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

EzTemplate defaults "chop" axes when writing to file #171

Open
durack1 opened this issue Apr 8, 2017 · 12 comments
Open

EzTemplate defaults "chop" axes when writing to file #171

durack1 opened this issue Apr 8, 2017 · 12 comments
Milestone

Comments

@durack1
Copy link
Member

durack1 commented Apr 8, 2017

@danlipsa @doutriaux1 the current EzTemplate defaults do not prevent the axes being written off the canvas, and so when an output file is written we get the below. I also note that the axes, legend etc overwrite one another:

eztemplate-broken

import EzTemplate
import vcs
import numpy as np

d = np.ones([10,10])
gm = vcs.createboxfill()
canvas = vcs.init(geometry=(2700, 2700), bg=True)
M = EzTemplate.Multi(columns=1,rows=2)
# First panel
t = M.get()
canvas.plot(d,gm,t)
# Second panel
t = M.get()
canvas.plot(d,gm,t)
canvas.png('EzTemplate-broken')

It would be good to revise these templates so that by default, all axes and informational text is captured within the bounds of the output format and that overwrites do not occur

@durack1 durack1 changed the title EzTemplate defaults allow axes to be "chopped" when writing to file EzTemplate defaults "chop" axes when writing to file Apr 8, 2017
@doutriaux1
Copy link
Contributor

@durack1 I don't understand the issue, all that EzTemplate does is rescaling your original template (or the default one if you do not pass one). So if your original template as axes on they will be drawn. What is the issue here?

@durack1
Copy link
Member Author

durack1 commented Apr 10, 2017

@doutriaux1 see the axis labels for the y-axis? They are chopped in half and unreadable.. The labeling is also overwriting other elements in the plots - even though these are defaults.. So the colorbar labels and the x-axis for the lower plot

@doutriaux1
Copy link
Contributor

I see. Ok that needs tweaking...

@doutriaux1
Copy link
Contributor

@durack1 in the case of y-axis. Should we attempt to scale down the font until it fits?

@doutriaux1
Copy link
Contributor

@durack1 I'm not sure what to do about variable_1 etc.. that end up on top of top plot. Should I add an option turn_off_unfit_objects if the end up being chopped or on top of others?

@durack1
Copy link
Member Author

durack1 commented Apr 10, 2017

@doutriaux1 with the example above, I think the font sizes are right.. I just think the plot area needs to be made to fit inside the canvas. So I would recommend making the plot areas smaller so that the overlaps no longer occur.. The descriptive info variable_1 etc should be kept, unless a user specifies these labels are off

@danlipsa
Copy link
Contributor

@doutriaux1 @durack1 If I remember correctly, I think there is a fundamental problem with vcs in that you can specify the area where the plot will be placed and then the labels are placed on the outside, regardless of the fact that they may be cut off. I think a proper fix would be to place the entire plot including the labels inside the specified area.

@durack1
Copy link
Member Author

durack1 commented Apr 10, 2017

@danlipsa thanks for chiming in, yes I think there is some rethinking to be done with the templates particularly now that many of the other elements are working correctly.. I'm happy to contribute to discussions when this issue gets addressed

@jypeter
Copy link
Member

jypeter commented Apr 27, 2017

This is just a related comment. How is a user supposed to find documentation about EzTemplate from the web site?

There is nothing about it on the site from Documentation or Documentation/Tutorials. And in Gallery/Template, there is only an example (a good one) about changing the templates by hand. Knowing about EzTemplate, I have googled "EzTemplate cdat" and found https://github.com/UV-CDAT/cdat-site/blob/master/eztemplate.md. But I don't know if this is actually somewhere on the web site

@doutriaux1 doutriaux1 modified the milestone: 3.0 May 5, 2017
@doutriaux1
Copy link
Contributor

@durack1 I get your point but EzTemplate really focuses on the data and legend area. I could add an option to fit_data_and_texts or something similar.

@gleckler1
Copy link

@doutriaux1 Something like fit_data_and_texts would be good. In some cases a user will want to combine lots of postage stamp sized figures, but the real appeal of EzTemplate is to enable users to quickly put together an array of panels (~ < 6x3) and for that having data+text controlled together would be a very powerful and popular capability

@doutriaux1
Copy link
Contributor

@gleckler1 will add. But ultimately you can't avoid having to do the final tweaks manually. For mass production I actually wouldn't recommend using EzTemplate. I think the way to go is to use EzTemplate first to get 99% of the way, thendo the last % manually, then save the templates and load them up at the beginning of mass production. @lee1043 I recommend you do this as well. It is faster to load a template from a json file, that using EzTemplate and move every attribute. It also definitely more memory efficient.

@doutriaux1 doutriaux1 modified the milestones: 3.0, post 3.0 Mar 29, 2018
@doutriaux1 doutriaux1 modified the milestones: 8.1, 8.2 Mar 27, 2019
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

5 participants