Scribus Forums

Scribus => Raster and Vector Graphics => Topic started by: raydiator on May 27, 2024, 12:39:41 PM

Title: SVG with clippath
Post by: raydiator on May 27, 2024, 12:39:41 PM
Does Scribus support SVG's with clippath? I have tried to plot a graph from excel or matplotlib but it loads entire path rather than a subsection of it (ie some outside the axis). A sample of svg is below from excel. It renders fine in brower or inkscape as they support clippath but within scribus it makes entire path visible.

Thanks

<svg width="1653" height="993" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" overflow="hidden"><defs><clipPath id="clip0"><rect x="1859" y="1364" width="1653" height="993"/></clipPath><clipPath id="clip1"><rect x="1990" y="1534" width="1462" height="718"/></clipPath></defs><g clip-path="url(#clip0)" transform="translate(-1859 -1364)"><rect x="1860" y="1365" width="1650" height="990" fill="#FFFFFF"/><g><path d="M1990.5 2169.57 3448.5 2169.57M1990.5 2089.57 3448.5 2089.57M1990.5 2010.57 3448.5 2010.57M1990.5 1931.56 3448.5 1931.56M1990.5 1851.56 3448.5 1851.56M1990.5 1772.56 3448.5 1772.56M1990.5 1693.56 3448.5 1693.56M1990.5 1613.55 3448.5 1613.55M1990.5 1534.5 3448.5 1534.5" stroke="#D9D9D9" stroke-width="3.4375" stroke-linejoin="round" stroke-miterlimit="10" fill="none"/></g><g><path d="M1990.5 1534.5 1990.5 2248.5M2281.57 1534.5 2281.57 2248.5M2573.58 1534.5 2573.58 2248.5M2865.59 1534.5 2865.59 2248.5M3157.6 1534.5 3157.6 2248.5M3448.5 1534.5 3448.5 2248.5" stroke="#D9D9D9" stroke-width="3.4375" stroke-linejoin="round" stroke-miterlimit="10" fill="none"/></g><g><path d="M0 0 0.000360892 714" stroke="#BFBFBF" stroke-width="3.4375" stroke-linejoin="round" stroke-miterlimit="10" fill="none" fill-rule="evenodd" transform="matrix(1 0 0 -1 1990.5 2248.5)"/></g><g><path d="M1990.5 2248.5 3448.5 2248.5" stroke="#BFBFBF" stroke-width="3.4375" stroke-linejoin="round" stroke-miterlimit="10" fill="none" fill-rule="evenodd"/></g><g clip-path="url(#clip1)"><path d="M-197.5 1609.5-51.5019 1671.55 94.5033 1729.56 239.508 1785.56 385.513 1837.56 531.518 1886.56 677.522 1932.56 823.527 1975.56 969.532 2015.57 1115.54 2051.57 1260.54 2085.57 1406.55 2115.57 1552.55 2142.57 1698.56 2166.57 1844.56 2186.57 1990.57 2204.57 2136.57 2218.57 2281.57 2229.57 2427.58 2237.57 2573.58 2242.57 2719.59 2243.5 2865.59 2242.57 3011.6 2237.57 3157.6 2229.57 3302.61 2218.57 3448.61 2204.57 3594.62 2186.57 3740.62 2166.57 3886.63 2142.57 4032.63 2115.57 4177.64 2085.57 4323.64 2051.57 4469.65 2015.57 4615.65 1975.56 4761.66 1932.56 4907.66 1886.56 5053.67 1837.56 5198.67 1785.56 5344.68 1729.56 5490.68 1671.55 5636.5 1609.5" stroke="#156082" stroke-width="6.875" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" fill="none"/></g><g><text fill="#595959" font-family="Aptos Narrow,Aptos Narrow_MSFontService,sans-serif" font-weight="400" font-stretch="semi-condensed" font-size="41" transform="matrix(1 0 0 1 1931.28 2260)">0</text></g><g><text fill="#595959" font-family="Aptos Narrow,Aptos Narrow_MSFontService,sans-serif" font-weight="400" font-stretch="semi-condensed" font-size="41" transform="matrix(1 0 0 1 1910.38 2181)">50</text></g><g><text fill="#595959" font-family="Aptos Narrow,Aptos Narrow_MSFontService,sans-serif" font-weight="400" font-stretch="semi-condensed" font-size="41" transform="matrix(1 0 0 1 1889.48 2102)">100</text></g><g><text fill="#595959" font-family="Aptos Narrow,Aptos Narrow_MSFontService,sans-serif" font-weight="400" font-stretch="semi-condensed" font-size="41" transform="matrix(1 0 0 1 1889.48 2022)">150</text></g><g><text fill="#595959" font-family="Aptos Narrow,Aptos Narrow_MSFontService,sans-serif" font-weight="400" font-stretch="semi-condensed" font-size="41" transform="matrix(1 0 0 1 1889.48 1943)">200</text></g><g><text fill="#595959" font-family="Aptos Narrow,Aptos Narrow_MSFontService,sans-serif" font-weight="400" font-stretch="semi-condensed" font-size="41" transform="matrix(1 0 0 1 1889.48 1864)">250</text></g><g><text fill="#595959" font-family="Aptos Narrow,Aptos Narrow_MSFontService,sans-serif" font-weight="400" font-stretch="semi-condensed" font-size="41" transform="matrix(1 0 0 1 1889.48 1784)">300</text></g><g><text fill="#595959" font-family="Aptos Narrow,Aptos Narrow_MSFontService,sans-serif" font-weight="400" font-stretch="semi-condensed" font-size="41" transform="matrix(1 0 0 1 1889.48 1705)">350</text></g><g><text fill="#595959" font-family="Aptos Narrow,Aptos Narrow_MSFontService,sans-serif" font-weight="400" font-stretch="semi-condensed" font-size="41" transform="matrix(1 0 0 1 1889.48 1626)">400</text></g><g><text fill="#595959" font-family="Aptos Narrow,Aptos Narrow_MSFontService,sans-serif" font-weight="400" font-stretch="semi-condensed" font-size="41" transform="matrix(1 0 0 1 1889.48 1546)">450</text></g><g><text fill="#595959" font-family="Aptos Narrow,Aptos Narrow_MSFontService,sans-serif" font-weight="400" font-stretch="semi-condensed" font-size="41" transform="matrix(1 0 0 1 1973.5 2314)">-5</text></g><g><text fill="#595959" font-family="Aptos Narrow,Aptos Narrow_MSFontService,sans-serif" font-weight="400" font-stretch="semi-condensed" font-size="41" transform="matrix(1 0 0 1 2265.21 2314)">-3</text></g><g><text fill="#595959" font-family="Aptos Narrow,Aptos Narrow_MSFontService,sans-serif" font-weight="400" font-stretch="semi-condensed" font-size="41" transform="matrix(1 0 0 1 2556.92 2314)">-1</text></g><g><text fill="#595959" font-family="Aptos Narrow,Aptos Narrow_MSFontService,sans-serif" font-weight="400" font-stretch="semi-condensed" font-size="41" transform="matrix(1 0 0 1 2854.95 2314)">1</text></g><g><text fill="#595959" font-family="Aptos Narrow,Aptos Narrow_MSFontService,sans-serif" font-weight="400" font-stretch="semi-condensed" font-size="41" transform="matrix(1 0 0 1 3146.66 2314)">3</text></g><g><text fill="#595959" font-family="Aptos Narrow,Aptos Narrow_MSFontService,sans-serif" font-weight="400" font-stretch="semi-condensed" font-size="41" transform="matrix(1 0 0 1 3438.37 2314)">5</text></g><g><text fill="#595959" font-family="Aptos Narrow,Aptos Narrow_MSFontService,sans-serif" font-weight="400" font-stretch="semi-condensed" font-size="64" transform="matrix(1 0 0 1 2671.41 1459)">y</text></g><rect x="1860.5" y="1365.5" width="1650" height="990" stroke="#D9D9D9" stroke-width="3.4375" stroke-linejoin="round" stroke-miterlimit="10" fill="none"/></g></svg>

Title: Re: SVG with clippath
Post by: PatJr on May 27, 2024, 03:42:30 PM
I opened it in inkscape and saved it as a plain svg.
Imported in scribus with File>Import>Get Vector file
it kinda worked. Might take some tweeking to get just right but it did show up.

Title: Re: SVG with clippath
Post by: PatJr on May 28, 2024, 12:26:24 AM
this was easy to edit in inkscape
is this how it's supposed to look?
Title: Re: SVG with clippath
Post by: raydiator on May 28, 2024, 02:01:35 AM
Thanks. Yes that is how it is meant to look. Now the question still stands as I guess based on feedback that it doesn't support clippath.
The issue I have is I want to be able to do this frequently, so I need to find a way to script this to happen automatically. I don't want to have edit plots every time I need to insert them into document.