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

area combination fails when fixing contour plot #11

Closed
kzhooou opened this issue Apr 10, 2018 · 12 comments
Closed

area combination fails when fixing contour plot #11

kzhooou opened this issue Apr 10, 2018 · 12 comments

Comments

@kzhooou
Copy link

kzhooou commented Apr 10, 2018

brilliant script for fixing annoying white lines
but not working when I tried to fix the artifacts between areas (MatlabR2017a)

@Conclusio
Copy link
Owner

Could you please provide an example .eps file for your issue? I.e. the input file before calling 'epsclean'.
Otherwise I cannot really reproduce the problem.

Thank you.

@kzhooou
Copy link
Author

kzhooou commented Apr 10, 2018

Original.zip
Please see attached the original eps. Thanks ever so much that your script already helped a lot without the area combination

@Conclusio
Copy link
Owner

Thank you for the input.
I cleaned your file with R2016b cleaned.zip.
Please check if that is the expected result.

As of now, I do not have access to another Matlab version.
What exactly happens in your MatlabR2017a version?
No file created?
Broken file created?
Artifacts remain?

@kzhooou
Copy link
Author

kzhooou commented Apr 10, 2018

This is the same as what I've got from the combination option being set 'false', while the gaps between areas of different colours remain.
image

Or maybe do I misunderstand the effect of the option to combine areas?

@kzhooou
Copy link
Author

kzhooou commented Apr 10, 2018

with 'combineAreas',true, it ran for 9010.899407 seconds and generated a broken file

@Conclusio
Copy link
Owner

I see...
So, combineAreas combines only areas of equal colors/properties. That means the lines between different shaded areas will not disappear. But, I have a solution for you.

In the "cleaned" file, change line
/f/fill ld
to
/f{GS 1 LW S GR fill}bd
and move it below the /LW... line

This eliminates the lines (at least in my viewer).
I will add this fix to my script soon, because it is a simple fix.

combineAreas can be left to 'false' in your case.
Sorry about the runtime by the way, it really isn't much optimized for speed.

@kzhooou
Copy link
Author

kzhooou commented Apr 10, 2018

No worries on the speed it's good enough.

Small spikes appear when I did so
image
But I've found alternative way to make gaps less obvious using inkscape

Another small bug I experience is that the code does not always capture white filled areas, see below
image
Original_filledwhite.zip

highlighted are areas I fill white to cover the plot outside the boundary

@Conclusio
Copy link
Owner

Regarding the spikes: That's a shame, then the workaround needs improvement...
Regarding white filled areas: That's a Z-order problem. Use: epsclean(... , 'groupSoft',true); to handle that.

@kzhooou
Copy link
Author

kzhooou commented Apr 10, 2018

It works! Thanks again for your help!

@kzhooou kzhooou closed this as completed Apr 10, 2018
@Conclusio
Copy link
Owner

You're welcome.

On last time, regarding the spikes again:
You can eliminate them with choosing this statement instead:
/f{GS 0.01 LW S GR fill}bd

So the value 1 is changed to 0.01. What this statement in general does is drawing an additional polyline with the given width (0.01) around every area, basically eliminating gaps between areas.

@kzhooou
Copy link
Author

kzhooou commented Apr 10, 2018

It works perfectly! Cheers!!

@jbkajtar
Copy link

Brilliant! Editing that statement solved my problems too! Thank you!

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

3 participants