You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that this is getting close enough to the point where people can start using it in notebooks, etc., I think it might help to improve some of the default aesthetics of the plots. The default settings for plots are producing graphs that aren't as aesthetically pleasing as other frameworks, but with a few slight tweaks to fonts, line size, spacing of numbers from the axis hatching, etc. I think the defaults could be made a lot nicer-looking.
For example, as a starting point, it would be nice if the following matplotlib plot:
could be replicated using default settings for the framework, plus enabling a grid. Even that example isn't the greatest in terms of formatting, but people coming from matplotlib will expect something at least that readable.
We should find other examples of really nice-looking plots and see if they can be replicated in this framework with the right settings. That would give good targets for defaults on fonts, etc. at different plot sizes.
Fetching https://github.com/PureSwift/CFreeType.giterror: dependency graph is unresolvable; found these conflicting requirements:Dependencies: https://github.com/PureSwift/CFreeType.git @ 1.0.4
The repo has a 1.0.4 tag. Am I doing something wrong?
Meanwhile I'll get to work on #29
By adding FreeType as a dependency, will that require FreeType to be installed as a library before using the AGG renderer? Or is that commonly installed on systems and in environments like Colab?
What are you using in your Package.swift to pull in CFreeType? That error does sound odd, but I've hit that when I was trying to do an exact match and I got the release numbers slightly wrong.
I think the release number isn't a problem, because I cloned the repo, deleted the git repository, initialized my own git repository, pushed my own tag, but still got the same error.
Sorry, mean to ask: what is the exact code you're using in your Package.swift? I can try it on my end with a dummy project to see if I can figure out what's wrong.
import PackageDescription
letpackage= Package(
name:"SwiftPlot",
products:[
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name:"SwiftPlot",
targets:["AGG","lodepng","CPPAGGRenderer","CAGGRenderer","SwiftPlot","SVGRenderer","AGGRenderer"]),],
dependencies:[
// Dependencies declare other packages that this package depends on.
.package(url:"https://github.com/PureSwift/CFreeType.git",.exact("1.0.4")),],
targets:[
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name:"AGG",
dependencies:[],
path:"framework/AGG"),.target(.....other targets
@BradLarson@marcrasi I'm trying to use the code from this branch in Jupyter. But I'm unable to use FreeType there:
'CFreeType' /tmp/tmp7jj615q3/swift-install/package/.build/checkouts/CFreeType: error: configuration of package 'CFreeType' is invalid; the 'pkgConfig' property can only be used with a System Module Package
Install Error: swift-build returned nonzero exit code 1.
This is what I get. Also in the terminal I get this: 'CFreeType' /home/karthik/swiftplot/.build/checkouts/CFreeType: warning: system packages are deprecated; use system library targets instead
I tried searching on the web. But nothing helped. Any ideas?
It works when you do swift build / swift run, but you get that error when you try to use it through jupyter?
Is it possible that you're using different versions of the swift toolchain from the commandline and from jupyter? Try running these commands to see:
which swift
swift package --version
<path to toolchain used in jupyter>/usr/bin/swift package --version
Maybe changing it to use a system library target (like you have in the commented out code in your CFreeType Package.swift) will help. Do you also get problems if you try it with that?
Thanks @marcrasi it builds now!
But plotting in Jupyter isn't working.
It still works with the old code. The one tagged 0.0.1 on GitHub.
I'll try to look into it soon.
I'm getting this error in the terminal https://pastebin.com/Ty00PWg8
Did you try out an example plot? Did it work for you?
Activity
KarthikRIyer commentedon Jul 13, 2019
I'll get to work on this next.
KarthikRIyer commentedon Jul 18, 2019
@BradLarson @marcrasi to use a different font with AGG I will need to import truetype as a dependency. AGG has provisions to use different fonts using truetype. So, I tried importing this: https://github.com/PureSwift/CFreeType
but I am getting this error:
The repo has a 1.0.4 tag. Am I doing something wrong?
Meanwhile I'll get to work on #29
BradLarson commentedon Jul 18, 2019
By adding FreeType as a dependency, will that require FreeType to be installed as a library before using the AGG renderer? Or is that commonly installed on systems and in environments like Colab?
What are you using in your Package.swift to pull in CFreeType? That error does sound odd, but I've hit that when I was trying to do an exact match and I got the release numbers slightly wrong.
KarthikRIyer commentedon Jul 18, 2019
FreeType is commonly installed on Ubuntu atleast.
I think the release number isn't a problem, because I cloned the repo, deleted the git repository, initialized my own git repository, pushed my own tag, but still got the same error.
BradLarson commentedon Jul 18, 2019
Sorry, mean to ask: what is the exact code you're using in your Package.swift? I can try it on my end with a dummy project to see if I can figure out what's wrong.
KarthikRIyer commentedon Jul 18, 2019
BradLarson commentedon Jul 18, 2019
Ah, I think the real problem might be due to CFreeType relying on Swift Package Manager 3.0.2 tooling. If I instead use
I get the following error:
You could try forking that and updating the CFreeType package's tools version on your end to see if that lets you import it.
KarthikRIyer commentedon Jul 21, 2019
This was the problem. I am able to import it now.
KarthikRIyer commentedon Aug 6, 2019
@BradLarson @marcrasi I'm trying to use the code from this branch in Jupyter. But I'm unable to use FreeType there:
This is what I get. Also in the terminal I get this:
'CFreeType' /home/karthik/swiftplot/.build/checkouts/CFreeType: warning: system packages are deprecated; use system library targets insteadI tried searching on the web. But nothing helped. Any ideas?
marcrasi commentedon Aug 12, 2019
It works when you do
swift build/swift run, but you get that error when you try to use it through jupyter?Is it possible that you're using different versions of the swift toolchain from the commandline and from jupyter? Try running these commands to see:
which swiftswift package --version<path to toolchain used in jupyter>/usr/bin/swift package --versionMaybe changing it to use a system library target (like you have in the commented out code in your CFreeType Package.swift) will help. Do you also get problems if you try it with that?
KarthikRIyer commentedon Aug 12, 2019
Yes
I do not remember remember the path which I used with jupyter. (I've got two versions). But I am pretty sure I must be using the same one.
Using the system library targets gave errors when building on Mac. That's why I changed it.
KarthikRIyer commentedon Aug 22, 2019
@marcrasi any ideas on how to get FreeType working in Jupyter?
marcrasi commentedon Aug 26, 2019
I'll try to run it myself today and see if I can figure anything out.
marcrasi commentedon Aug 27, 2019
Try adding this. I think it made it work for me:
%install-swiftpm-flags -Xcc -isystem/usr/include/freetype2 -Xswiftc -lfreetypeKarthikRIyer commentedon Aug 28, 2019
Thanks @marcrasi it builds now!
But plotting in Jupyter isn't working.
It still works with the old code. The one tagged 0.0.1 on GitHub.
I'll try to look into it soon.
I'm getting this error in the terminal https://pastebin.com/Ty00PWg8
Did you try out an example plot? Did it work for you?