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

Grid not saved when not exporting to pdf #134

Open
bpedersen2 opened this issue Feb 8, 2021 · 11 comments
Open

Grid not saved when not exporting to pdf #134

bpedersen2 opened this issue Feb 8, 2021 · 11 comments

Comments

@bpedersen2
Copy link
Contributor

We observer that a defined grid is not exported unless the format is pdf.
( in gr 1.16 .1 to 1.17.2 as used in nicos)

See also https://forge.frm2.tum.de/redmine/issues/4322

@bpedersen2
Copy link
Contributor Author

Details: save is called from an QT InteractiveGrWidget .

@jheinen
Copy link
Collaborator

jheinen commented Feb 8, 2021

Isn't this issue more about python-gr?

@bpedersen2
Copy link
Contributor Author

Yes,, probably

@birkenfeld
Copy link
Contributor

Well, the save is initiated by the python-gr widget, which calls gr.beginprint(filename), self.draw (which is the same code that draws for interactive use) and then gr.endprint()...

@birkenfeld
Copy link
Contributor

We checked with SVG output and saw that the grid lines are present, but their width is set to 0px.

Is the grid line width selected by gr or python-gr?

@jheinen
Copy link
Collaborator

jheinen commented Mar 9, 2021

@birkenfeld : Could you provide a MWE, or, can you re-produce the behaviour in a simple Python/Julia script?

@birkenfeld
Copy link
Contributor

I will try.

@birkenfeld
Copy link
Contributor

Ok, found the culprit in our code, you can close this.

@birkenfeld
Copy link
Contributor

Well, actually... We do a gr.setlinewidth(0) around drawing; the commit message for that change says "avoid rescaling axis linewidth". So this is probably to work around the issue that sometimes lines would be unbearably wide for large plot sizes.

But still - why does the linewidth of 0 result in visible lines in Qt output but not in SVG/PDF?

@jheinen
Copy link
Collaborator

jheinen commented Mar 9, 2021

In the underlying backends, the linewidth might be used either as an absolute value or a scale factor. In other words, the value can not be handled in the same manner on different devices (pixel vs. vector graphics). In this case, we could probably use a minimum value instead of 0.

@cfelder
Copy link
Contributor

cfelder commented Jan 11, 2022

this has been fixed on NICOS using a minimal line width of 0.1.

imho this can be closed.

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

4 participants