mzmine / old-mzmine3

Old development repository (outdated)
GNU General Public License v2.0
13 stars 17 forks source link

Vector export - ensure exported lines are contiguous #96

Open photocyte opened 8 years ago

photocyte commented 8 years ago

Currently in MZmine2 when a line representing data is exported (e.g. TIC plot) into a vector file such as .eps, it is actually made of multiple discrete line segments. On the other hand, Xcalibur (when printing a TIC), produces a vector file with a single contiguous line / TIC. This makes it much easier to edit in downstream vector manipulation software (Adobe Illustrator / Inkscape). This would be a nice perk to have in MZMine3 (though is likely strongly dependent on graphics library quirks)

dyrlund commented 8 years ago

JFreeChart does not support EMF and EPS exports which is why this was implemented using FreeHEP in MZmine 2. I don't know if it is possible to set a parameter in FreeHEP to allow for contiguous lines.

tomas-pluskal commented 8 years ago

I asked at the JFreeChart forum, and apparently there is an easy solution to this. Setting this flag should help:

http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.html#setDrawSeriesLineAsPath-boolean-

I will make the change for both MZmine 2 and 3.

photocyte commented 8 years ago

:+1: thanks!

dyrlund commented 8 years ago

@tomas-pluskal Would it be possible to set this for the spectra plots also? I tested your changes in MZmine 2 and it works great for e.g. XIC plots but MS spectra (In both MZmine 2 and 3) are still made up of multiple discrete line segments.

tomas-pluskal commented 8 years ago

I did add it to the spectrum plot as well:

https://github.com/mzmine/mzmine2/blob/master/src/main/java/net/sf/mzmine/modules/visualization/spectra/renderers/ContinuousRenderer.java#L75

But I haven't tested it myself yet. Did you try it using the latest sources?

dyrlund commented 8 years ago

Yep, here are my exports from before and after your change: EPS files.zip

tomas-pluskal commented 8 years ago

I guess it's because you're looking at centroid spectra. It won't work for centroid, because these are separate, discrete lines (by definition).

dyrlund commented 8 years ago

Ahh, true! And there is no way to connect the lines at the 0-intensity to form one continuous line?

tomas-pluskal commented 8 years ago

It might be possible.. However, there will be other glitches - e.g., if you select the "show data points" option, you will see points at the zero level.

dyrlund commented 8 years ago

I see - so if we wanted this we would have to only connect the lines before exporting the data.