Comments (11)
yeah I think python interprets those special characters, so you need to escape the escape characters :).
try : "\\n" instead of "\n"
from pygnuplot.
thanks .. but still no luck
using \n it prints → 06.12.\n12
using one single \n it result an error.
full command: gp.c("set xtics format '%d.%m\n%HUhr' textcolor 'black'")
one more idea?
from pygnuplot.
does this one work: gp.c(r"set xtics format '%d.%m\n%HUhr' textcolor 'black'")
?
from pygnuplot.
still no luck :(
it through no error. but still no linefeed at this point.
from pygnuplot.
It prints "06.12\n12" as label, no linefeed but \n is printed instead
from pygnuplot.
no more idea?
from pygnuplot.
For the meantime, you could once type them in in gnuplot then use : save 'myfile.gn'.
open "myfile.gn" edit / shorten it to your needs and load that one when needed.
can you please tell me the full command string that you are trying to generate and pass from python to gnuplot?
i.e. example code ?
from pygnuplot.
It might be good to "prepare" the '%d.%m\n%h' string beforehand, i.e. store it in a separate variable, so you can check if python is parsing it right.
from pygnuplot.
sorry. tried a lot of things without luck. here is a easy example.
linefeed is ignored or \n is printed but not done.
example makes no sense, but I'm only interested in \n to linefeed.
import PyGnuplot as gp
gp.c("set title 'XXXXXXXXXXXXXXXXXXXXXXX")
gp.c(r"set xtics format 'Line1\nLine2' textcolor 'black'")
gp.c("plot [-10:10] sin(x),atan(x),cos(atan(x))")
from pygnuplot.
Just running this directly in gnuplot gives me the exact same results as run via PyGnuplot.
So I tried changing the command itself until I got a new line working:
set xtics format "Line1\nLine2" textcolor "black"
turns out gnuplot requires " marks not ' marks ;).
so your command needs to be:
gp.c("set title 'XXXXXXXXXXXXXXXXXXXXXXX'")
gp.c(r'set xtics format "Line1\nLine2" textcolor "black"')
gp.c("plot [-10:10] sin(x),atan(x),cos(atan(x))")
from pygnuplot.
hello Ben.
Yes this works fine.
Thank you very much!
from pygnuplot.
Related Issues (18)
- Example Figures HOT 1
- Close gnuplot (window) HOT 4
- Error saving a pdf (on MacOS) using pdfcario HOT 3
- Feature Request: kwarg passthrough for _FigureList.__init__
- if gunplot is not installed, you get a cryptic error message HOT 1
- PyGnuplot on windows doesnt work out of the box HOT 2
- PNG/JPG output? HOT 1
- Figure handling - a suggestion for improvement HOT 1
- The read function uses the wrong queue HOT 2
- How to use PyGnuplot with Jupyter notebook!
- Another suggestion HOT 1
- support in python3 HOT 4
- PyGnuplot TypeError: a bytes-like object is required, not 'str' on Python 3.6.1 Windows 7 HOT 2
- PyGnuplot no error output, no output file from gnuplot HOT 8
- PyGnuplot .s restrictions HOT 6
- PyGnuplot feature request: capture & return of stdout/stderr info HOT 1
- Create Debian package for Debian and Ubuntu HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygnuplot.