I've got a few macros that perform floating point lookups and calculations for me and I'm interesting in plotting their results. They're the kind of calculation which requires if/else, so they can't be easily written as a simple math formula for \addplot.  I've been able to plot the results using a \foreach, but only by having a separate \addplot for each point in the series:  \foreach \x in {1,...,100}{   \edef\temp{\noexpand \addplot coordinates{ (\x,\myMacro{\x}) }; }   \temp }   Granted, I'm sure that I could force it to look like one data series, but that seems like a very inelegant solution. Is it possible to define a data series where y values are provided by a LaTeX macro?  Something like  \addplot{    \coordinates{      foreach \x in {1,...,100){        (\x,\myMacro{\x})      }    } };   or  \addplot[variableICanPassToMacro=\x, domain=1:100] ({\x},{\myMacro{\x}});   ?
I've got a few macros that perform floating point lookups and calculations for me and I'm interesting in plotting their results. They're the kind of calculation which requires if/else, so they can't be easily written as a simple math formula for \addplot.  Thanks to a previous question (), I now know to use \pgfmathdeclarefunction, but after trying it I've found that addplot seems to prepend a "0Y" or "1Y" to values before passing them as function arguments. My external macros aren't prepared to handle this extra text, and I'm not sure why it's there.   In the course of testing things out, I've also found that calling a function defined with pgfmathdeclarefunction can also change the positioning of the graph...  \documentclass{article}  \usepackage{xparse}  \usepackage{pgfplots} \pgfplotsset{compat=1.10}  \begin{document}  % Example of a macro which does math outside of pgf     \ExplSyntaxOn     \DeclareExpandableDocumentCommand \doubleMacro { m }%      {%       \fp_eval:n { #1*2 }%Math performed by a package other than pgfplots      }%     \ExplSyntaxOff    %Demo: macro does work in regular text \doubleMacro{1.1}.  % Defining custom pgf functions for plotting      \pgfmathdeclarefunction{mathDoubleMacro}{1}{%         \pgfmathparse{\doubleMacro{#1}} %Calls macro which performs math done by another package     }      \pgfmathdeclarefunction{mathDoublePgf}{1}{%         \pgfmathparse{#1*2} %Uses pgf to do the same thing as an external macro could     }  %Generic plot with function given directly to \addplot \begin{center} \begin{tikzpicture}     \begin{axis}         \addplot[domain=0:1] {2*x};     \end{axis} \end{tikzpicture} \end{center}  %Plot using first macro: complains about 'Unknown fp word Y.' \begin{center} \begin{tikzpicture}     \begin{axis}         %\addplot[domain=0:1] {mathDoubleMacro(x)};%Commented out because it gives problems     \end{axis} \end{tikzpicture} \end{center}  %Plot using second macro: works, but graph is displaced to the right of the expected position \begin{center} \begin{tikzpicture}     \begin{axis}         \addplot[domain=0:1] {mathDoublePgf(x)};     \end{axis} \end{tikzpicture} \end{center}  \end{document}   If I define mathDoubleMacro as calling a non-existent macro, then the errors show which x-values which the addplot is trying to evaluate y at:    0Y0.0e0  1Y4.1666e-2 1Y8.3332e-2 ...  1Y9.9998401e-1   What are these nY's all about, and why does \addplot[domain=0:1] {mathDoublePgf(x)} give a graph with different positioning?
Is it possible to add subtitles of a figure which contains subfigures I have a single image which contains two sub-images. I want the following subtitles (a) and (b) to be shown correctly.   In which, left sides is my current image which contains two rectangular. And right sides is my expected result. I found a solution is that we can use subfig package. However, it requires separating the original figure into two subfigure. In that question, I am regarding that we do not need split original figure, I want to write (a),(b) directly below figure. Thanks Current solution is  \begin{figure}[H] \captionsetup{labelfont={bf}}   \centering     \subfloat[]{\centering\includegraphics[scale=0.5]{Fig1a.png}} \\     \subfloat[]{\centering\includegraphics[scale=0.5]{Fig1b.png}}   \caption{This is main figure}   \label{fig:9} \end{figure} UV mapping not filling faces Does light pollution affect sleep quality while already asleep? Many articles on the internet write about melatonin and its effects, making you tired. A lot of articles also point out how the use of devices before going to bed in modern days likely decrease melatonin production. Therefore, making it harder to fall asleep. But this information is only about the process of getting to sleep, before we are actually sleeping.  A recent Harvard Medical article 1 states:     High exposure to bright, artificial outdoor lights during the night may result in sleepless nights for older adults.   Referring to a publication on Nov. 15, 2018, in the Journal of Clinical Sleep Medicine.  Considering that:    many people nowadays, use their mobile devices in bed prior to going to sleep; modern cities or houses have (street) lights that are always enabled at night; ignoring the phase of falling sleep; focusing only on the time we are asleep already, so during the actual sleep cycles.   Does a darker room with less or no (artificial) light pollution improve sleep quality, with all associated health benefits as a result? In other words: Does light pollution, while asleep decrease the sleep quality or does light pollution only negatively affect the phase of “falling asleep”?  I wasn't able to find any studies or information regarding sleep quality in relation to light pollution during sleep. Were such studies performed? Are there specific moments when light pollution affects sleep quality the most, for example during REM-sleep or in a specific sleeping phase?    1 Why is integration the inverse of differentiation Why is integration the inverse of differentiation, I mean why do I get the same function when I integrate and then differentiate the result? Method defined as testMethod do not support web service callouts, test skipped How can I recover deleted photos from an SD Card? My technophobe mother returned from a European trip to discover she'd erased all but 15 images from a nearly full 2GB card. As I am the computer guy in the family, she posted the card to me and asked that I make something magical happen.  The photos were taken with and deleted by a Nikon Coolpix. (I don't know the model.)  I am a Linux guy, but there is a Windows Vista box at my disposal.  What is my best strategy to try to recover something? Where can I find the application executables in the filesystem? Let $\Gamma$ be a circle that passes through the origin. Show that we can find real numbers $s$ and $t$ such that $\Gamma$ is the graph of $r = 2s \cos (\theta + t).$  I know this has to be converted to a cartesian equation, but how do I do this, and what do I do after?  Thanks Is acceleration relative in relativity? Suppose a box A is moving relative to a Box B, then by time dilation equation if I take 1 sec passed for an observer in A then for an observer in B will be little longer. Now if I suppose that the box B is moving while A is stationary under the same condition, then by the time dilation equation time passed in B must be shorter than A. How is this issue resolved? In the twin paradox problem my book says that it's due to acceleration, but in my opinion acceleration is relative (please correct me if I'm wrong), but here it is not the case. If $f$ is entire and $|f|\geq 1$, then show $f$ is constant. I know I'm going to use Liouville's Theorem, but my main question is why is $1/|f(z)|$ entire as well if $f$ is entire? Is this just a basic property: if $f$ is entire, then $1/f$ is entire? Thanks for the help. I ran into an interesting (and very frustrating) issue with the equals() method today which caused what I thought to be a well tested class to crash and cause a bug that took me a very long time to track down.   Just for completeness, I wasn't using an IDE or debugger - just good old fashioned text editor and System.out's. Time was very limited and it was a school project.  Anyhow -   I was developing a basic shopping cart which could contain an ArrayList of Book objects. In order to implement the addBook(), removeBook(), and hasBook() methods of the Cart, I wanted to check if the Book already existed in the Cart. So off I go -  public boolean equals(Book b) {     ... // More code here - null checks     if (b.getID() == this.getID()) return true;     else return false; }   All works fine in testing. I create 6 objects and fill them with data. Do many adds, removes, has() operations on the Cart and everything works fine. I read that you can either have equals(TYPE var) or equals(Object o) { (CAST) var } but assumed that since it was working, it didn't matter too much.  Then I ran into a problem - I needed to create a Book object with only the ID in it from within the Book class. No other data would be entered into it. Basically the following:  public boolean hasBook(int i) {     Book b = new Book(i);     return hasBook(b); }  public boolean hasBook(Book b) {     // .. more code here     return this.books.contains(b); }   All of a sudden, the equals(Book b) method no longer works. This took a VERY long time to track down without a good debugger and assuming the Cart class was properly tested and correct. After swaapping the equals() method to the following:  public boolean equals(Object o) {     Book b = (Book) o;     ... // The rest goes here    }   Everything began to work again. Is there a reason the method decided not to take the Book parameter even though it clearly  was  a Book object? The only difference seemed to be it was instantiated from within the same class, and only filled with one data member. I'm very very confused. Please, shed some light? ArcGIS Python Tool - Importing Custom Script Into ToolValidator Class If $\gcd (x,4) = 2$ and $\gcd(y,4) = 2$ then $\gcd(x+y,4) = 4$ I was working my way through some number theoretic proofs and being a newbie am stuck on this problem :     If $(x, 4) = 2$ and $(y, 4) =2$, then $(x + y, 4) = 4$,     where $(a,b)$ denotes the greatest common divisor of $a$ and $b$.   My Solution  (Incorrect)   $x-4 = 2t$ $y-4 = 2p$ $x + y - 8 = 2(t+p) \Rightarrow x + y - 4 = 2f + 4 = 2(f+2)\Rightarrow 2$ divides $(x+y , 4)$   My Question:  My solution is definitely inadequate. Can someone help me out? Undocumented increase in minimum bounty value? I recently discovered that if I have posted an answer to a question, the minimum bounty I can offer for that question is +100 (instead of the usual +50).   Temporarily deleting the answer reinstates the +50 bounty (a workaround!).  As far as I can tell, this is not mentioned in  , , or . I've also tried  but didn't get very far.  So:   Should the FAQs be updated to include this information? Why have this rule in the first place if it's so easily bypassed?     Update:  This is indeed a new feature (introduced in ) to .This is mentioned explicitly in a few   but, as far as I can tell, not in FAQs. This information is therefore out of reach of mere mortals who do not have a finger on the pulse of MSO/SE.   The loophole mentioned above , but as of this update, can still be exploited (tested on superuser).  We can haz bugfix and faq update, pliz? Add Word Limit to Posts Ubuntu Won't Boot After Install on Samsung NP915S3G: error "All boot options are tried." So yesterday I went ahead and bought the Samsung NP915S3G (ATIV Book 9 Lite) and installed Tahr in hope that everything would go smoothly. For the most part it; everything necessary seems to work off the bat. Unfortunately when I restart it, nothing boots. I erased Windows so that's obviously not an option, but the computer seems pretty dead certain that there's nothing there to boot. I think this might have a lot to do with UEFI which is a field I have next to no experience with. There also seems to be a fat32 partition that consistently reappears when I delete it.   Any help is much appreciated, thanks. Is there a bijective function mapping Natural numbers to Natural numbers, other than $f(n) = n$? Is there a function that can be bijective, with the set of natural numbers as domain and range, other than $f(n) = n$? Whole disk unallocated? Gparted error or partition overlapping? Our son is about to turn 3 months but he is yet to sleep on his own (as in we put him to sleep, put him down on the crib then he sleeps for few hours). He only sleeps when he is carried during the day, the moment we put him down he wakes up crying. At night, he sleeps with us on the bed where he is right next to his mommy. We blame ourselves for letting this happen but now my wife can't do anything during the day but carry him.  What can we do to break him out of this habit? Any pointers would be great appreciated. I am using the 2D Animation preset and so far every new scene I made had the same bright white background. Now my two latest scenes (created with 'copy settings') have a light grey background even though they are set to white. There's also no difference in surface, nodes or strength.  There are apparently exist different background shades with an off-white color but selecting the white one doesn't help either